abortIf($this->connection->getDatabasePlatform()->getName() !== 'sqlite', 'Migration can only be executed safely on \'sqlite\'.'); $this->addSql('CREATE TABLE hero (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER NOT NULL, name VARCHAR(32) NOT NULL)'); $this->addSql('CREATE UNIQUE INDEX UNIQ_51CE6E865E237E06 ON hero (name)'); $this->addSql('CREATE INDEX IDX_51CE6E86A76ED395 ON hero (user_id)'); $this->addSql('CREATE TABLE user (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(32) NOT NULL, password VARCHAR(255) NOT NULL, api_token VARCHAR(255) DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:json) )'); $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649F85E0677 ON user (username)'); $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D6497BA2F5EB ON user (api_token)'); } public function down(Schema $schema) : void { // this down() migration is auto-generated, please modify it to your needs $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'sqlite', 'Migration can only be executed safely on \'sqlite\'.'); $this->addSql('DROP TABLE hero'); $this->addSql('DROP TABLE user'); } }