migrations/Version20220209101301.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220209101301 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         $this->addSql("CREATE TABLE IF NOT EXISTS `std_cookies` (
  18.             `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique identifier',
  19.             `unique_key` varchar(50) NOT NULL COMMENT 'Cookie unique key',
  20.             `funcional_accepted` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Funcional cookies accepted',
  21.             `valid_until` datetime NOT NULL COMMENT 'Cookies valid until',
  22.             `webuser_id` int(10) unsigned DEFAULT NULL COMMENT 'Web user unique identifider',
  23.             `created_date` datetime NOT NULL COMMENT 'Date and time of the record creation',
  24.             `updated_date` datetime NOT NULL COMMENT 'Date and time the record was last updated',
  25.             `created_by` int(10) unsigned DEFAULT NULL COMMENT 'Unique identifier',
  26.             `updated_by` int(10) unsigned DEFAULT NULL COMMENT 'Unique identifier',
  27.             PRIMARY KEY (`id`),
  28.             UNIQUE KEY `uniqueKey` (`unique_key`) USING BTREE,
  29.             KEY `FK_std_cookies_std_web_users` (`webuser_id`),
  30.             KEY `FK_std_cookies_std_web_users_2` (`created_by`),
  31.             KEY `FK_std_cookies_std_web_users_3` (`updated_by`),
  32.             CONSTRAINT `FK_std_cookies_std_web_users` FOREIGN KEY (`webuser_id`) REFERENCES `std_web_users` (`id`),
  33.             CONSTRAINT `FK_std_cookies_std_web_users_2` FOREIGN KEY (`created_by`) REFERENCES `std_web_users` (`id`),
  34.             CONSTRAINT `FK_std_cookies_std_web_users_3` FOREIGN KEY (`updated_by`) REFERENCES `std_web_users` (`id`)
  35.           ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;");
  36.     }
  37.     public function down(Schema $schema) : void
  38.     {
  39.         $this->addSql("DROP TABLE `std_cookies`;");
  40.     }
  41. }