Changed uuid type in database

This commit is contained in:
Nicolas Lœuillet 2016-12-23 09:49:22 +01:00
parent 8137515171
commit 89cd670abf
6 changed files with 5 additions and 11 deletions

View file

@ -5,14 +5,13 @@ services:
- redis - redis
# faster builds on docker-container setup # faster builds on docker-container setup
sudo: required sudo: false
# used for HHVM # used for HHVM
addons: addons:
apt: apt:
packages: packages:
- tidy - tidy
postgresql: 9.5
# cache vendor dirs # cache vendor dirs
cache: cache:
@ -60,7 +59,6 @@ before_script:
- if [[ ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi - if [[ ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
- composer self-update --no-progress - composer self-update --no-progress
- if [[ $DB = pgsql ]]; then psql -c 'create database wallabag_test;' -U postgres; fi; - if [[ $DB = pgsql ]]; then psql -c 'create database wallabag_test;' -U postgres; fi;
- if [[ $DB = pgsql ]]; then psql -U postgres wallabag_test -c 'create extension "uuid-ossp";'; fi;
install: install:
- if [[ $ASSETS = build ]]; then source ~/.nvm/nvm.sh && nvm install 6.7; fi; - if [[ $ASSETS = build ]]; then source ~/.nvm/nvm.sh && nvm install 6.7; fi;

View file

@ -27,8 +27,7 @@ build: ## Run grunt
@grunt @grunt
test: ## Launch wallabag testsuite test: ## Launch wallabag testsuite
@if [ ! -d "vendor/phpunit" ]; then composer install; fi @ant prepare && bin/simple-phpunit -v
@ant prepare && vendor/phpunit/phpunit/phpunit -v
release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`). release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
ifndef VERSION ifndef VERSION

View file

@ -33,8 +33,9 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI
$this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.'); $this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.');
$entryTable->addColumn('uuid', 'guid', [ $entryTable->addColumn('uuid', 'string', [
'notnull' => false, 'notnull' => false,
'length' => 23,
]); ]);
$this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_public', '1', 'entry')"); $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_public', '1', 'entry')");
} }

View file

@ -355,9 +355,6 @@ class EntryController extends Controller
{ {
$this->checkUserAction($entry); $this->checkUserAction($entry);
$version = $this->getDoctrine()->getManager()->getConnection()->query('SELECT version();')->fetchColumn();
var_dump($version);
return $this->render( return $this->render(
'WallabagCoreBundle:Entry:entry.html.twig', 'WallabagCoreBundle:Entry:entry.html.twig',
['entry' => $entry] ['entry' => $entry]

View file

@ -47,7 +47,7 @@ class Entry
/** /**
* @var string * @var string
* *
* @ORM\Column(name="uuid", type="guid", nullable=true) * @ORM\Column(name="uuid", type="string", length=23, nullable=true)
* *
* @Groups({"entries_for_user", "export_all"}) * @Groups({"entries_for_user", "export_all"})
*/ */

View file

@ -816,7 +816,6 @@ class EntryControllerTest extends WallabagCoreTestCase
// generating the uuid // generating the uuid
$client->request('GET', '/share/'.$content->getId()); $client->request('GET', '/share/'.$content->getId());
var_dump($client->getResponse()->getContent());
$this->assertEquals(302, $client->getResponse()->getStatusCode()); $this->assertEquals(302, $client->getResponse()->getStatusCode());
// follow link with uuid // follow link with uuid