From fd7fde95159828960784a438c4b4da147e20ab18 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 2 May 2017 08:38:22 +0200 Subject: Force sequence creation for postgresql --- app/DoctrineMigrations/Version20170501115751.php | 61 ++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 app/DoctrineMigrations/Version20170501115751.php (limited to 'app/DoctrineMigrations/Version20170501115751.php') diff --git a/app/DoctrineMigrations/Version20170501115751.php b/app/DoctrineMigrations/Version20170501115751.php new file mode 100644 index 00000000..846a87b5 --- /dev/null +++ b/app/DoctrineMigrations/Version20170501115751.php @@ -0,0 +1,61 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix').$tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->skipIf($schema->hasTable($this->getTable('site_credential')), 'It seems that you already played this migration.'); + + $table = $schema->createTable($this->getTable('site_credential')); + $table->addColumn('id', 'integer', ['autoincrement' => true]); + $table->addColumn('user_id', 'integer'); + $table->addColumn('host', 'string', ['length' => 255]); + $table->addColumn('username', 'string', ['length' => 255]); + $table->addColumn('password', 'string', ['length' => 255]); + $table->addColumn('createdAt', 'datetime'); + $table->addIndex(['user_id'], 'idx_user'); + $table->setPrimaryKey(['id']); + $table->addForeignKeyConstraint($this->getTable('user'), ['user_id'], ['id'], [], 'fk_user'); + + if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) { + $schema->dropSequence('site_credential_id_seq'); + $schema->createSequence('site_credential_id_seq'); + } + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $schema->dropTable($this->getTable('site_credential')); + } +} -- cgit v1.2.3 From 906424c1b6fd884bf2081bfe6dd0b1f9651c2801 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 11 Jun 2017 23:05:19 +0200 Subject: Crypt site credential password --- app/DoctrineMigrations/Version20170501115751.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/DoctrineMigrations/Version20170501115751.php') diff --git a/app/DoctrineMigrations/Version20170501115751.php b/app/DoctrineMigrations/Version20170501115751.php index 846a87b5..2597f1ff 100644 --- a/app/DoctrineMigrations/Version20170501115751.php +++ b/app/DoctrineMigrations/Version20170501115751.php @@ -39,7 +39,7 @@ class Version20170501115751 extends AbstractMigration implements ContainerAwareI $table->addColumn('user_id', 'integer'); $table->addColumn('host', 'string', ['length' => 255]); $table->addColumn('username', 'string', ['length' => 255]); - $table->addColumn('password', 'string', ['length' => 255]); + $table->addColumn('password', 'text'); $table->addColumn('createdAt', 'datetime'); $table->addIndex(['user_id'], 'idx_user'); $table->setPrimaryKey(['id']); -- cgit v1.2.3 From bead8b42da4f17238dc0d5e0f90184b224ec5df7 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 14 Jun 2017 15:02:34 +0200 Subject: Fix reviews Encrypt username too Redirect to list after saving credentials Fix typos Signed-off-by: Thomas Citharel --- app/DoctrineMigrations/Version20170501115751.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/DoctrineMigrations/Version20170501115751.php') diff --git a/app/DoctrineMigrations/Version20170501115751.php b/app/DoctrineMigrations/Version20170501115751.php index 2597f1ff..7f068eb8 100644 --- a/app/DoctrineMigrations/Version20170501115751.php +++ b/app/DoctrineMigrations/Version20170501115751.php @@ -38,7 +38,7 @@ class Version20170501115751 extends AbstractMigration implements ContainerAwareI $table->addColumn('id', 'integer', ['autoincrement' => true]); $table->addColumn('user_id', 'integer'); $table->addColumn('host', 'string', ['length' => 255]); - $table->addColumn('username', 'string', ['length' => 255]); + $table->addColumn('username', 'text'); $table->addColumn('password', 'text'); $table->addColumn('createdAt', 'datetime'); $table->addIndex(['user_id'], 'idx_user'); -- cgit v1.2.3 From f808b01692a835673f328d7221ba8c212caa9b61 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 1 Jul 2017 09:52:38 +0200 Subject: Add a real configuration for CS-Fixer --- app/DoctrineMigrations/Version20170501115751.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app/DoctrineMigrations/Version20170501115751.php') diff --git a/app/DoctrineMigrations/Version20170501115751.php b/app/DoctrineMigrations/Version20170501115751.php index 7f068eb8..adf2f841 100644 --- a/app/DoctrineMigrations/Version20170501115751.php +++ b/app/DoctrineMigrations/Version20170501115751.php @@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Add site credential table to store username & password for some website (behind authentication or paywall) + * Add site credential table to store username & password for some website (behind authentication or paywall). */ class Version20170501115751 extends AbstractMigration implements ContainerAwareInterface { @@ -22,11 +22,6 @@ class Version20170501115751 extends AbstractMigration implements ContainerAwareI $this->container = $container; } - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix').$tableName; - } - /** * @param Schema $schema */ @@ -58,4 +53,9 @@ class Version20170501115751 extends AbstractMigration implements ContainerAwareI { $schema->dropTable($this->getTable('site_credential')); } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } } -- cgit v1.2.3