Browse Source

Added a migration to fix the data model

master
Diane 2 years ago
parent
commit
a5957f5efc
No known key found for this signature in database GPG Key ID: B13153D92467FCC1
  1. 18
      db/migrations/20200527153034_fix_generated.php

18
db/migrations/20200527153034_fix_generated.php

@ -0,0 +1,18 @@
<?php
use Phinx\Migration\AbstractMigration;
class FixGenerated extends AbstractMigration
{
public function up()
{
$this->execute('ALTER TABLE articles ALTER COLUMN id SET GENERATED BY DEFAULT;');
$this->execute('ALTER TABLE categories ALTER COLUMN id SET GENERATED BY DEFAULT;');
}
public function down()
{
$this->execute('ALTER TABLE articles ALTER COLUMN id SET GENERATED ALWAYS;');
$this->execute('ALTER TABLE categories ALTER COLUMN id SET GENERATED ALWAYS;');
}
}
Loading…
Cancel
Save