|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace DoctrineMigrations; |
|
6
|
|
|
|
|
7
|
|
|
use Doctrine\DBAL\Schema\Schema; |
|
8
|
|
|
use Doctrine\Migrations\AbstractMigration; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Auto-generated Migration: Please modify to your needs! |
|
12
|
|
|
*/ |
|
13
|
|
|
final class Version20250719103338 extends AbstractMigration |
|
14
|
|
|
{ |
|
15
|
|
|
public function getDescription(): string |
|
16
|
|
|
{ |
|
17
|
|
|
return ''; |
|
18
|
|
|
} |
|
19
|
|
|
|
|
20
|
|
|
public function up(Schema $schema): void |
|
21
|
|
|
{ |
|
22
|
|
|
// this up() migration is auto-generated, please modify it to your needs |
|
23
|
|
|
$this->addSql('CREATE TABLE book (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, title VARCHAR(255) NOT NULL, isbn VARCHAR(13) DEFAULT NULL, author VARCHAR(255) DEFAULT NULL, img VARCHAR(255) DEFAULT NULL)'); |
|
24
|
|
|
$this->addSql('CREATE TABLE product (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL, value INTEGER NOT NULL)'); |
|
25
|
|
|
$this->addSql('CREATE TABLE messenger_messages (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, body CLOB NOT NULL, headers CLOB NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL --(DC2Type:datetime_immutable) |
|
26
|
|
|
, available_at DATETIME NOT NULL --(DC2Type:datetime_immutable) |
|
27
|
|
|
, delivered_at DATETIME DEFAULT NULL --(DC2Type:datetime_immutable) |
|
28
|
|
|
)'); |
|
29
|
|
|
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)'); |
|
30
|
|
|
$this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)'); |
|
31
|
|
|
$this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)'); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
public function down(Schema $schema): void |
|
35
|
|
|
{ |
|
36
|
|
|
// this down() migration is auto-generated, please modify it to your needs |
|
37
|
|
|
$this->addSql('DROP TABLE book'); |
|
38
|
|
|
$this->addSql('DROP TABLE product'); |
|
39
|
|
|
$this->addSql('DROP TABLE messenger_messages'); |
|
40
|
|
|
} |
|
41
|
|
|
} |
|
42
|
|
|
|