From d308e0bb5e5150d5bfbda652cd652e78fb15251f Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Fri, 28 Oct 2016 12:43:51 -0500 Subject: [PATCH] Add primary key as auto increment in c_student_publication_comment - #1475 --- .../Schema/V111/Version20161028123400.php | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 app/Migrations/Schema/V111/Version20161028123400.php diff --git a/app/Migrations/Schema/V111/Version20161028123400.php b/app/Migrations/Schema/V111/Version20161028123400.php new file mode 100644 index 0000000000..e47789e646 --- /dev/null +++ b/app/Migrations/Schema/V111/Version20161028123400.php @@ -0,0 +1,40 @@ +getTable('c_student_publication_comment') + ->getColumn('iid'); + + if (!$iidColumn->getAutoincrement()) { + $iidColumn->setAutoincrement(true); + } + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $schema + ->getTable('c_student_publication_comment') + ->getColumn('iid') + ->setAutoincrement(false); + } +}