diff --git a/src/Db/Setup.yml b/src/Db/Setup.yml index a9fb644b..1d374c18 100644 --- a/src/Db/Setup.yml +++ b/src/Db/Setup.yml @@ -5,6 +5,7 @@ services: calls: - [addVersion, ["@db.setup.schema.version.1_0_0"]] - [addVersion, ["@db.setup.schema.version.2_0_0"]] + - [addVersion, ["@db.setup.schema.version.3_0_0"]] db.setup: public: false alias: neighborhoods.kojo.db.setup diff --git a/src/Db/Setup/Schema/Version_3_0_0.php b/src/Db/Setup/Schema/Version_3_0_0.php new file mode 100644 index 00000000..9c383f7f --- /dev/null +++ b/src/Db/Setup/Schema/Version_3_0_0.php @@ -0,0 +1,32 @@ +_getDoctrineConnectionDecoratorRepository(); + $createSchema = $connectionDecoratorRepository->createSchema(DecoratorInterface::ID_SCHEMA); + $createTable = $createSchema->createTable(JobStateChange\RepositoryInterface::TABLE_NAME); + $createTable->addColumn(JobStateChangeInterface::PROP_ID, Type::BIGINT, + [ + 'autoincrement' => true, + 'unsigned' => true + ] + ); + $createTable->setPrimaryKey([JobStateChangeInterface::PROP_ID]); + $createTable->addColumn(JobStateChangeInterface::PROP_DATA, Type::JSON); + $this->_setCreateTable($createTable); + + return $this; + } +} diff --git a/src/Db/Setup/Schema/Version_3_0_0.yml b/src/Db/Setup/Schema/Version_3_0_0.yml new file mode 100644 index 00000000..349690f3 --- /dev/null +++ b/src/Db/Setup/Schema/Version_3_0_0.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.db.setup.schema.version.3_0_0: + class: Neighborhoods\Kojo\Db\Setup\Schema\Version_3_0_0 + calls: + - [setDoctrineConnectionDecoratorRepository, ["@doctrine.connection.decorator.repository"]] + - [setTableName, ["@=constant(\"\\\\Neighborhoods\\\\Kojo\\\\JobStateChange\\\\RepositoryInterface::TABLE_NAME\")"]] + db.setup.schema.version.3_0_0: + alias: neighborhoods.kojo.db.setup.schema.version.3_0_0 diff --git a/src/Db/TearDown.yml b/src/Db/TearDown.yml index f430b27a..162e7dc6 100644 --- a/src/Db/TearDown.yml +++ b/src/Db/TearDown.yml @@ -3,6 +3,7 @@ services: public: false class: Neighborhoods\Kojo\Db\TearDown calls: + - [addVersion, ["@db.tear_down.schema.version.6_0_0"]] - [addVersion, ["@db.tear_down.schema.version.5_0_0"]] - [addVersion, ["@db.tear_down.schema.version.4_0_0"]] - [addVersion, ["@db.tear_down.schema.version.3_0_0"]] diff --git a/src/Db/TearDown/Schema/Version_6_0_0.php b/src/Db/TearDown/Schema/Version_6_0_0.php new file mode 100644 index 00000000..f711cddc --- /dev/null +++ b/src/Db/TearDown/Schema/Version_6_0_0.php @@ -0,0 +1,18 @@ +setTableName(JobStateChange\RepositoryInterface::TABLE_NAME); + + return $this; + } +} diff --git a/src/Db/TearDown/Schema/Version_6_0_0.yml b/src/Db/TearDown/Schema/Version_6_0_0.yml new file mode 100644 index 00000000..29d2e4ae --- /dev/null +++ b/src/Db/TearDown/Schema/Version_6_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.tear_down.schema.version.6_0_0: + class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_6_0_0 + calls: + - [setDoctrineConnectionDecoratorRepository, ["@doctrine.connection.decorator.repository"]] + db.tear_down.schema.version.6_0_0: + alias: neighborhoods.kojo.db.tear_down.schema.version.6_0_0