copypaste/migrations/Version20230720115905.php

31 lines
980 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
2023-07-21 13:27:04 +00:00
final class Version20230720115905 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE SEQUENCE paste_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
2023-07-21 17:48:42 +00:00
$this->addSql('CREATE TABLE paste (id INT NOT NULL, text TEXT NOT NULL, language VARCHAR(25), description TEXT, filename VARCHAR(128), author VARCHAR(128) NOT NULL, publish_date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, expiration_date TIMESTAMP(0) WITHOUT TIME ZONE, ip VARCHAR(15) NOT NULL, secret VARCHAR(40), PRIMARY KEY(id))');
}
public function down(Schema $schema): void
{
$this->addSql('CREATE SCHEMA public');
$this->addSql('DROP SEQUENCE paste_id_seq CASCADE');
$this->addSql('DROP TABLE paste');
}
}