Skip to content
Snippets Groups Projects
Commit ebcdec21 authored by Camille Simiand's avatar Camille Simiand Committed by Sebastien
Browse files

Fix Capsule entity and migration

parent 20c8ed0b
No related branches found
No related tags found
3 merge requests!43tuleap-83-access-my-capsules,!42Draft: access-my-capsules-conflicts-fixed,!40Draft: Tuleap 83 access my capsules
......@@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20211215132322 extends AbstractMigration
final class Version20211215142553 extends AbstractMigration
{
public function getDescription(): string
{
......@@ -20,7 +20,7 @@ final class Version20211215132322 extends AbstractMigration
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE capsule (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(255) NOT NULL, aut_crea VARCHAR(255) NOT NULL, dt_crea DATETIME NOT NULL, aut_maj VARCHAR(255) NOT NULL, dt_maj DATETIME NOT NULL, link VARCHAR(255) NOT NULL, edition_link VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE capsule (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(255) NOT NULL, aut_crea INT NOT NULL, dt_crea DATETIME NOT NULL, aut_maj INT DEFAULT 0 NOT NULL, dt_maj DATETIME DEFAULT \'0\' NOT NULL, link VARCHAR(255) NOT NULL, edition_link VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE editeur_capsule (capsule_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_A18592E2714704E9 (capsule_id), INDEX IDX_A18592E2A76ED395 (user_id), PRIMARY KEY(capsule_id, user_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE editeur_capsule ADD CONSTRAINT FK_A18592E2714704E9 FOREIGN KEY (capsule_id) REFERENCES capsule (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE editeur_capsule ADD CONSTRAINT FK_A18592E2A76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id) ON DELETE CASCADE');
......@@ -30,6 +30,7 @@ final class Version20211215132322 extends AbstractMigration
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE editeur_capsule DROP FOREIGN KEY FK_A18592E2714704E9');
$this->addSql('ALTER TABLE editeur_capsule DROP FOREIGN KEY FK_A18592E2A76ED395');
$this->addSql('DROP TABLE capsule');
$this->addSql('DROP TABLE editeur_capsule');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment