<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170112142109 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
// 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 revisions (id INT AUTO_INCREMENT NOT NULL, timestamp DATETIME NOT NULL, username VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE hoard_audit (id INT NOT NULL, rev INT NOT NULL, hoard_type_id INT DEFAULT NULL, country_id INT DEFAULT NULL, province_id INT DEFAULT NULL, find_spot_location_detail_id INT DEFAULT NULL, closing_reign1_id INT DEFAULT NULL, closing_reign2_id INT DEFAULT NULL, discovery_method_id INT DEFAULT NULL, discovery_land_use_id INT DEFAULT NULL, archaeology_recovery_method_id INT DEFAULT NULL, archaeology_site_context_id INT DEFAULT NULL, archaeology_site_context_detail_id INT DEFAULT NULL, archaeology_period_id INT DEFAULT NULL, archaeology_context_nature_id INT DEFAULT NULL, archaeology_end_period_id INT DEFAULT NULL, find_spot_rating_id INT DEFAULT NULL, archaeology_rating_id INT DEFAULT NULL, contextual_rating_id INT DEFAULT NULL, rating_id INT DEFAULT NULL, hide_what_id INT DEFAULT NULL, hide_from_id INT DEFAULT NULL, created_by INT DEFAULT NULL, modified_by INT DEFAULT NULL, find_spot_name VARCHAR(255) DEFAULT NULL, find_spot_other_names VARCHAR(255) DEFAULT NULL, address VARCHAR(255) DEFAULT NULL, city VARCHAR(255) DEFAULT NULL, county VARCHAR(255) DEFAULT NULL, region VARCHAR(255) DEFAULT NULL, find_spot_lattitude DOUBLE PRECISION DEFAULT NULL, find_spot_longitude DOUBLE PRECISION DEFAULT NULL, find_spot_altitude DOUBLE PRECISION DEFAULT NULL, find_spot_comment LONGTEXT DEFAULT NULL, discovery_day1 INT DEFAULT NULL, discovery_month1 INT DEFAULT NULL, discovery_year1 INT DEFAULT NULL, discovery_day2 INT DEFAULT NULL, discovery_month2 INT DEFAULT NULL, discovery_year2 INT DEFAULT NULL, opening_year1 INT DEFAULT NULL, opening_year2 INT DEFAULT NULL, closing_year1 INT DEFAULT NULL, closing_year2 INT DEFAULT NULL, terminal_year1 INT DEFAULT NULL, terminal_year2 INT DEFAULT NULL, reference_string LONGTEXT DEFAULT NULL, to_enter_at_coin_level TINYINT(1) DEFAULT NULL, discovery_depth VARCHAR(255) DEFAULT NULL, owner VARCHAR(255) DEFAULT NULL, finder VARCHAR(255) DEFAULT NULL, discovery_comment LONGTEXT DEFAULT NULL, archaeology_start_year INT DEFAULT NULL, archaeology_end_year INT DEFAULT NULL, archaeology_natural_features VARCHAR(255) DEFAULT NULL, archaeology_site_comment LONGTEXT DEFAULT NULL, archaeology_context_date1 INT DEFAULT NULL, archaeology_context_date2 INT DEFAULT NULL, archaeology_associated_features LONGTEXT DEFAULT NULL, rating_comment LONGTEXT DEFAULT NULL, validated_by_user TINYINT(1) DEFAULT NULL, validated_by_admin TINYINT(1) DEFAULT NULL, deleted TINYINT(1) DEFAULT NULL, deletedAt DATETIME DEFAULT NULL, credit LONGTEXT DEFAULT NULL, creation_date DATETIME DEFAULT NULL, modified_date DATETIME DEFAULT NULL, comment LONGTEXT DEFAULT NULL, revtype VARCHAR(4) NOT NULL, PRIMARY KEY(id, rev)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE person_audit (id INT NOT NULL, rev INT NOT NULL, period1_id INT DEFAULT NULL, period2_id INT DEFAULT NULL, created_by INT DEFAULT NULL, modified_by INT DEFAULT NULL, person VARCHAR(255) DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, start_date INT DEFAULT NULL, end_date INT DEFAULT NULL, uri1 VARCHAR(255) DEFAULT NULL, uri2 VARCHAR(255) DEFAULT NULL, deleted TINYINT(1) DEFAULT NULL, creation_date DATETIME DEFAULT NULL, modified_date DATETIME DEFAULT NULL, comment LONGTEXT DEFAULT NULL, revtype VARCHAR(4) NOT NULL, PRIMARY KEY(id, rev)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE container_audit (id INT NOT NULL, rev INT NOT NULL, container_sherd_id INT DEFAULT NULL, container_form_id INT DEFAULT NULL, hoard_id INT DEFAULT NULL, material_id INT DEFAULT NULL, created_by INT DEFAULT NULL, modified_by INT DEFAULT NULL, container VARCHAR(100) DEFAULT NULL, uri1 VARCHAR(255) DEFAULT NULL, uri2 VARCHAR(255) DEFAULT NULL, deleted TINYINT(1) DEFAULT NULL, deletedAt DATETIME DEFAULT NULL, creation_date DATETIME DEFAULT NULL, modified_date DATETIME DEFAULT NULL, comment LONGTEXT DEFAULT NULL, revtype VARCHAR(4) NOT NULL, PRIMARY KEY(id, rev)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE denomination_audit (id INT NOT NULL, rev INT NOT NULL, material_id INT DEFAULT NULL, created_by INT DEFAULT NULL, modified_by INT DEFAULT NULL, denomination VARCHAR(255) DEFAULT NULL, uri1 VARCHAR(255) DEFAULT NULL, uri2 VARCHAR(255) DEFAULT NULL, deleted TINYINT(1) DEFAULT NULL, creation_date DATETIME DEFAULT NULL, modified_date DATETIME DEFAULT NULL, comment LONGTEXT DEFAULT NULL, revtype VARCHAR(4) NOT NULL, PRIMARY KEY(id, rev)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE reign_audit (id INT NOT NULL, rev INT NOT NULL, period1_id INT DEFAULT NULL, period2_id INT DEFAULT NULL, created_by INT DEFAULT NULL, modified_by INT DEFAULT NULL, reign VARCHAR(255) DEFAULT NULL, start_date INT DEFAULT NULL, end_date INT DEFAULT NULL, uri1 VARCHAR(255) DEFAULT NULL, uri2 VARCHAR(255) DEFAULT NULL, deleted TINYINT(1) DEFAULT NULL, creation_date DATETIME DEFAULT NULL, modified_date DATETIME DEFAULT NULL, comment LONGTEXT DEFAULT NULL, revtype VARCHAR(4) NOT NULL, PRIMARY KEY(id, rev)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE mint_audit (id INT NOT NULL, rev INT NOT NULL, period_id INT DEFAULT NULL, created_by INT DEFAULT NULL, modified_by INT DEFAULT NULL, mint VARCHAR(255) DEFAULT NULL, lattitude DOUBLE PRECISION DEFAULT NULL, longitude DOUBLE PRECISION DEFAULT NULL, uri1 VARCHAR(255) DEFAULT NULL, uri2 VARCHAR(255) DEFAULT NULL, deleted TINYINT(1) DEFAULT NULL, creation_date DATETIME DEFAULT NULL, modified_date DATETIME DEFAULT NULL, comment LONGTEXT DEFAULT NULL, revtype VARCHAR(4) NOT NULL, PRIMARY KEY(id, rev)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE reference_audit (id INT NOT NULL, rev INT NOT NULL, reference_type_id INT DEFAULT NULL, created_by INT DEFAULT NULL, modified_by INT DEFAULT NULL, authors VARCHAR(255) DEFAULT NULL, editors VARCHAR(255) DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, title_edition VARCHAR(50) DEFAULT NULL, volume VARCHAR(30) DEFAULT NULL, place VARCHAR(20) DEFAULT NULL, year INT DEFAULT NULL, pages VARCHAR(20) DEFAULT NULL, abbreviation VARCHAR(255) DEFAULT NULL, uri1 VARCHAR(255) DEFAULT NULL, uri1_accession_date DATETIME DEFAULT NULL, uri2 VARCHAR(255) DEFAULT NULL, uri2_accession_date DATETIME DEFAULT NULL, fully_entered TINYINT(1) DEFAULT NULL, deleted TINYINT(1) DEFAULT NULL, deletedAt DATETIME DEFAULT NULL, filePath VARCHAR(255) DEFAULT NULL, creation_date DATETIME DEFAULT NULL, modified_date DATETIME DEFAULT NULL, comment LONGTEXT DEFAULT NULL, revtype VARCHAR(4) NOT NULL, PRIMARY KEY(id, rev)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE coin_audit (id INT NOT NULL, rev INT NOT NULL, hoard_id INT DEFAULT NULL, condition_id INT DEFAULT NULL, container_id INT DEFAULT NULL, layer_id INT DEFAULT NULL, period_id INT DEFAULT NULL, created_by INT DEFAULT NULL, modified_by INT DEFAULT NULL, starting_date INT DEFAULT NULL, ending_date INT DEFAULT NULL, date_text VARCHAR(255) DEFAULT NULL, issue INT DEFAULT NULL, officina INT DEFAULT NULL, obverse_inscription VARCHAR(255) DEFAULT NULL, obverse_mint_mark VARCHAR(50) DEFAULT NULL, obverse_description LONGTEXT DEFAULT NULL, reverse_inscription VARCHAR(255) DEFAULT NULL, reverse_mint_mark VARCHAR(50) DEFAULT NULL, reverse_description LONGTEXT DEFAULT NULL, weight DOUBLE PRECISION DEFAULT NULL, quantity INT DEFAULT NULL, diameter DOUBLE PRECISION DEFAULT NULL, axis INT DEFAULT NULL, imitation TINYINT(1) DEFAULT NULL, latest_coin TINYINT(1) DEFAULT NULL, intruder TINYINT(1) DEFAULT NULL, to_check TINYINT(1) DEFAULT NULL, deleted TINYINT(1) DEFAULT NULL, creation_date DATETIME DEFAULT NULL, modified_date DATETIME DEFAULT NULL, comment LONGTEXT DEFAULT NULL, revtype VARCHAR(4) NOT NULL, PRIMARY KEY(id, rev)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE object_audit (id INT NOT NULL, rev INT NOT NULL, hoard_id INT DEFAULT NULL, container_id INT DEFAULT NULL, material_id INT DEFAULT NULL, created_by INT DEFAULT NULL, modified_by INT DEFAULT NULL, object VARCHAR(255) DEFAULT NULL, description LONGTEXT DEFAULT NULL, quantity INT DEFAULT NULL, production_place VARCHAR(200) DEFAULT NULL, weight DOUBLE PRECISION DEFAULT NULL, dimension_length_cm INT DEFAULT NULL, dimension_width_cm INT DEFAULT NULL, dimension_diameter_cm INT DEFAULT NULL, start_year INT DEFAULT NULL, end_year INT DEFAULT NULL, deleted TINYINT(1) DEFAULT NULL, deletedAt DATETIME DEFAULT NULL, creation_date DATETIME DEFAULT NULL, modified_date DATETIME DEFAULT NULL, comment LONGTEXT DEFAULT NULL, revtype VARCHAR(4) NOT NULL, PRIMARY KEY(id, rev)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
// this down() 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('DROP TABLE revisions');
$this->addSql('DROP TABLE hoard_audit');
$this->addSql('DROP TABLE person_audit');
$this->addSql('DROP TABLE container_audit');
$this->addSql('DROP TABLE denomination_audit');
$this->addSql('DROP TABLE reign_audit');
$this->addSql('DROP TABLE mint_audit');
$this->addSql('DROP TABLE reference_audit');
$this->addSql('DROP TABLE coin_audit');
$this->addSql('DROP TABLE hoard_coin_count');
$this->addSql('DROP TABLE object_audit');
}
}