// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SEQUENCE category_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE employee_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE incident_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE incident_type_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE mission_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE ride_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE skill_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE assignment (employee_id INT NOT NULL, ride_id INT NOT NULL, start_hour TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, end_hour TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(employee_id, ride_id))');
$this->addSql('CREATE INDEX IDX_30C544BA8C03F15C ON assignment (employee_id)');
$this->addSql('CREATE INDEX IDX_30C544BA302A8A70 ON assignment (ride_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_30C544BA8C03F15C302A8A70 ON assignment (employee_id, ride_id)');
$this->addSql('CREATE TABLE category (id INT NOT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE employee (id INT NOT NULL, missions_id INT DEFAULT NULL, incidents_id INT DEFAULT NULL, email VARCHAR(180) NOT NULL, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(30) NOT NULL, password VARCHAR(255) NOT NULL, roles JSON NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_5D9F75A117C042CF ON employee (missions_id)');
$this->addSql('CREATE INDEX IDX_5D9F75A155955332 ON employee (incidents_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL ON employee (email)');
$this->addSql('CREATE TABLE employee_skill (employee INT NOT NULL, skill INT NOT NULL, PRIMARY KEY(employee, skill))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B630E90E5D9F75A15E3DE477 ON employee_skill (employee, skill)');
$this->addSql('CREATE TABLE incident_type (id INT NOT NULL, incidents_id INT DEFAULT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_66D2209655955332 ON incident_type (incidents_id)');
$this->addSql('CREATE TABLE mission (id INT NOT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE mission_category (mission INT NOT NULL, category INT NOT NULL, PRIMARY KEY(mission, category))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_EB018789067F23C64C19C1 ON mission_category (mission, category)');
$this->addSql('CREATE TABLE representation (employee_id INT NOT NULL, ride_id INT NOT NULL, count INT NOT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(employee_id, ride_id))');
$this->addSql('CREATE INDEX IDX_29D5499E8C03F15C ON representation (employee_id)');
$this->addSql('CREATE INDEX IDX_29D5499E302A8A70 ON representation (ride_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_29D5499E8C03F15C302A8A70AA9E377A ON representation (employee_id, ride_id, date)');
$this->addSql('CREATE TABLE requirement (mission INT NOT NULL, skill INT NOT NULL, PRIMARY KEY(mission, skill))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_DB3F55509067F23C5E3DE477 ON requirement (mission, skill)');
$this->addSql('CREATE TABLE skill (id INT NOT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)');
$this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)');
$this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)');
$this->addSql('COMMENT ON COLUMN messenger_messages.created_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN messenger_messages.available_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN messenger_messages.delivered_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;');
$this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();');