2024-07-28 21:14:41 +02:00
< ? php
declare ( strict_types = 1 );
namespace DoctrineMigrations ;
use Doctrine\DBAL\Schema\Schema ;
use Doctrine\Migrations\AbstractMigration ;
/**
* Auto - generated Migration : Please modify to your needs !
*/
2024-07-28 23:05:41 +02:00
final class Version20240728210044 extends AbstractMigration
2024-07-28 21:14:41 +02:00
{
public function getDescription () : string
{
return '' ;
}
public function up ( Schema $schema ) : void
{
// this up() migration is auto-generated, please modify it to your needs
2024-07-28 23:05:41 +02:00
$this -> addSql ( 'CREATE SEQUENCE connector_id_seq INCREMENT BY 1 MINVALUE 1 START 1' );
$this -> addSql ( 'CREATE TABLE connector (id INT NOT NULL, user_id INT NOT NULL, auth_data JSON NOT NULL, provider VARCHAR(255) NOT NULL, PRIMARY KEY(id))' );
2024-07-28 21:14:41 +02:00
$this -> addSql ( 'CREATE INDEX IDX_148C456EA76ED395 ON connector (user_id)' );
$this -> addSql ( 'ALTER TABLE connector ADD CONSTRAINT FK_148C456EA76ED395 FOREIGN KEY (user_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE' );
}
public function down ( Schema $schema ) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this -> addSql ( 'CREATE SCHEMA public' );
2024-07-28 23:05:41 +02:00
$this -> addSql ( 'DROP SEQUENCE connector_id_seq CASCADE' );
2024-07-28 21:14:41 +02:00
$this -> addSql ( 'ALTER TABLE connector DROP CONSTRAINT FK_148C456EA76ED395' );
$this -> addSql ( 'DROP TABLE connector' );
}
}