// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName()!=='mysql','Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE sonata_menu (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, alias VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE sonata_menu_item (id INT AUTO_INCREMENT NOT NULL, parent INT DEFAULT NULL, menu INT NOT NULL, name VARCHAR(255) NOT NULL, url VARCHAR(255) DEFAULT NULL, class_attribute VARCHAR(255) DEFAULT NULL, position SMALLINT UNSIGNED DEFAULT NULL, target TINYINT(1) DEFAULT \'0\', enabled TINYINT(1) DEFAULT \'1\', INDEX IDX_57D4FCFA3D8E604F (parent), INDEX IDX_57D4FCFA7D053A93 (menu), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE sonata_menu_item ADD CONSTRAINT FK_57D4FCFA3D8E604F FOREIGN KEY (parent) REFERENCES sonata_menu_item (id) ON DELETE SET NULL');