- Basic HTML templates
- Created entities & new migration - Added packages symfony/stimulus-bundle & symfony/webpack-encore-bundle
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20230909100148 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE user ADD display_name VARCHAR(64) NOT NULL, ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE `user` DROP display_name, DROP created_at, DROP updated_at');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20231014080536 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE TABLE comment (id INT AUTO_INCREMENT NOT NULL, page_id INT NOT NULL, user_id INT DEFAULT NULL, parent_comment_id INT DEFAULT NULL, deleted_by_user_id INT DEFAULT NULL, markdown LONGTEXT NOT NULL, html LONGTEXT NOT NULL, score INT NOT NULL, state VARCHAR(32) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_9474526CC4663E4 (page_id), INDEX IDX_9474526CA76ED395 (user_id), INDEX IDX_9474526CBF2AF943 (parent_comment_id), INDEX IDX_9474526CFCF2A97A (deleted_by_user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE domain_page (id INT AUTO_INCREMENT NOT NULL, domain_id INT NOT NULL, path LONGTEXT NOT NULL, locked TINYINT(1) NOT NULL, comment_count INT NOT NULL, title LONGTEXT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_B9D69B47115F0EE5 (domain_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE page_view (id INT AUTO_INCREMENT NOT NULL, page_id INT NOT NULL, user_id INT DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_7939B754C4663E4 (page_id), INDEX IDX_7939B754A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526CC4663E4 FOREIGN KEY (page_id) REFERENCES domain_page (id)');
|
||||
$this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526CA76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id)');
|
||||
$this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526CBF2AF943 FOREIGN KEY (parent_comment_id) REFERENCES comment (id)');
|
||||
$this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526CFCF2A97A FOREIGN KEY (deleted_by_user_id) REFERENCES `user` (id)');
|
||||
$this->addSql('ALTER TABLE domain_page ADD CONSTRAINT FK_B9D69B47115F0EE5 FOREIGN KEY (domain_id) REFERENCES domain (id)');
|
||||
$this->addSql('ALTER TABLE page_view ADD CONSTRAINT FK_7939B754C4663E4 FOREIGN KEY (page_id) REFERENCES domain_page (id)');
|
||||
$this->addSql('ALTER TABLE page_view ADD CONSTRAINT FK_7939B754A76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE comment DROP FOREIGN KEY FK_9474526CC4663E4');
|
||||
$this->addSql('ALTER TABLE comment DROP FOREIGN KEY FK_9474526CA76ED395');
|
||||
$this->addSql('ALTER TABLE comment DROP FOREIGN KEY FK_9474526CBF2AF943');
|
||||
$this->addSql('ALTER TABLE comment DROP FOREIGN KEY FK_9474526CFCF2A97A');
|
||||
$this->addSql('ALTER TABLE domain_page DROP FOREIGN KEY FK_B9D69B47115F0EE5');
|
||||
$this->addSql('ALTER TABLE page_view DROP FOREIGN KEY FK_7939B754C4663E4');
|
||||
$this->addSql('ALTER TABLE page_view DROP FOREIGN KEY FK_7939B754A76ED395');
|
||||
$this->addSql('DROP TABLE comment');
|
||||
$this->addSql('DROP TABLE domain_page');
|
||||
$this->addSql('DROP TABLE page_view');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user