-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from neighborhoods/KOJO-149-state-transition-c…
…hange-migration KOJO-149 | State Transition Change migration
- Loading branch information
Showing
6 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Db\Setup\Schema; | ||
|
||
use Doctrine\DBAL\Types\Type; | ||
use Neighborhoods\Kojo\Db\Schema\VersionAbstract; | ||
use Neighborhoods\Kojo\Db\Schema\VersionInterface; | ||
use Neighborhoods\Kojo\Doctrine\Connection\DecoratorInterface; | ||
use Neighborhoods\Kojo\JobStateChangeInterface; | ||
use Neighborhoods\Kojo\JobStateChange; | ||
|
||
class Version_3_0_0 extends VersionAbstract | ||
{ | ||
protected function _assembleSchemaChanges(): VersionInterface | ||
{ | ||
$connectionDecoratorRepository = $this->_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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Db\TearDown\Schema; | ||
|
||
use Neighborhoods\Kojo\Db\Schema\VersionAbstract; | ||
use Neighborhoods\Kojo\Db\Schema\VersionInterface; | ||
use Neighborhoods\Kojo\JobStateChange; | ||
|
||
class Version_6_0_0 extends VersionAbstract | ||
{ | ||
protected function _assembleSchemaChanges(): VersionInterface | ||
{ | ||
$this->setTableName(JobStateChange\RepositoryInterface::TABLE_NAME); | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |