test_server/migrations/Version20250327185727.php

39 lines
1.8 KiB
PHP

<?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 Version20250327185727 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('DROP TABLE client');
$this->addSql('DROP TABLE refresh_token');
$this->addSql('DROP TABLE auth_code');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('CREATE TABLE client (identifier VARCHAR(32) NOT NULL, secret VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, active BOOLEAN NOT NULL, redirect_uris JSON NOT NULL, grants JSON NOT NULL, scopes JSON NOT NULL, allow_plain_text_pkce BOOLEAN DEFAULT false NOT NULL, PRIMARY KEY(identifier))');
$this->addSql('CREATE TABLE refresh_token (identifier VARCHAR(80) NOT NULL, expiry TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, access_token_identifier VARCHAR(80) NOT NULL, revoked BOOLEAN NOT NULL, PRIMARY KEY(identifier))');
$this->addSql('COMMENT ON COLUMN refresh_token.expiry IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('CREATE TABLE auth_code (identifier VARCHAR(80) NOT NULL, expiry TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, user_identifier VARCHAR(255) DEFAULT NULL, client_identifier VARCHAR(32) NOT NULL, redirect_uri VARCHAR(255) DEFAULT NULL, revoked BOOLEAN NOT NULL, scopes JSON NOT NULL, PRIMARY KEY(identifier))');
$this->addSql('COMMENT ON COLUMN auth_code.expiry IS \'(DC2Type:datetime_immutable)\'');
}
}