diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/DoctrineMigrations/Version20190401105353.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/DoctrineMigrations/Version20190401105353.php b/app/DoctrineMigrations/Version20190401105353.php index 4afc8b15..c1c22053 100644 --- a/app/DoctrineMigrations/Version20190401105353.php +++ b/app/DoctrineMigrations/Version20190401105353.php | |||
@@ -20,7 +20,7 @@ class Version20190401105353 extends WallabagMigration | |||
20 | $this->skipIf($entryTable->hasColumn('hashed_url'), 'It seems that you already played this migration.'); | 20 | $this->skipIf($entryTable->hasColumn('hashed_url'), 'It seems that you already played this migration.'); |
21 | 21 | ||
22 | $entryTable->addColumn('hashed_url', 'text', [ | 22 | $entryTable->addColumn('hashed_url', 'text', [ |
23 | 'length' => 32, | 23 | 'length' => 40, |
24 | 'notnull' => false, | 24 | 'notnull' => false, |
25 | ]); | 25 | ]); |
26 | 26 | ||
@@ -28,6 +28,8 @@ class Version20190401105353 extends WallabagMigration | |||
28 | if ('sqlite' !== $this->connection->getDatabasePlatform()->getName()) { | 28 | if ('sqlite' !== $this->connection->getDatabasePlatform()->getName()) { |
29 | $this->addSql('UPDATE ' . $this->getTable('entry') . ' SET hashed_url = MD5(url)'); | 29 | $this->addSql('UPDATE ' . $this->getTable('entry') . ' SET hashed_url = MD5(url)'); |
30 | } | 30 | } |
31 | |||
32 | $entryTable->addIndex(['user_id', 'hashed_url'], 'hashed_url_user_id'); | ||
31 | } | 33 | } |
32 | 34 | ||
33 | /** | 35 | /** |
@@ -39,6 +41,7 @@ class Version20190401105353 extends WallabagMigration | |||
39 | 41 | ||
40 | $this->skipIf(!$entryTable->hasColumn('hashed_url'), 'It seems that you already played this migration.'); | 42 | $this->skipIf(!$entryTable->hasColumn('hashed_url'), 'It seems that you already played this migration.'); |
41 | 43 | ||
44 | $entryTable->dropIndex('hashed_url_user_id'); | ||
42 | $entryTable->dropColumn('hashed_url'); | 45 | $entryTable->dropColumn('hashed_url'); |
43 | } | 46 | } |
44 | } | 47 | } |