<?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 Version20220518072007 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('CREATE TABLE leave_application (id INT AUTO_INCREMENT NOT NULL, leavename_id INT NOT NULL, emp_id INT NOT NULL, from_days DATE NOT NULL, to_days DATE NOT NULL, reasons VARCHAR(500) NOT NULL, address VARCHAR(400) DEFAULT NULL, contact_no VARCHAR(50) DEFAULT NULL, special_remarks VARCHAR(500) DEFAULT NULL, status INT NOT NULL, type INT DEFAULT NULL, entryby INT DEFAULT NULL, entrydate DATETIME DEFAULT NULL, editby INT DEFAULT NULL, editdate DATETIME DEFAULT NULL, fh_approval INT DEFAULT NULL, fh_approval_by INT DEFAULT NULL, fh_approval_date DATETIME DEFAULT NULL, dh_approval INT DEFAULT NULL, dh_approval_by INT DEFAULT NULL, dh_approval_date DATETIME DEFAULT NULL, INDEX IDX_178D3896BEE2E5FA (leavename_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
        $this->addSql('CREATE TABLE leavename (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, days INT DEFAULT NULL, remarks VARCHAR(255) DEFAULT NULL, status INT DEFAULT NULL, type INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
        $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, full_name VARCHAR(255) NOT NULL, office_phone VARCHAR(50) DEFAULT NULL, office_email VARCHAR(60) DEFAULT NULL, functional_head INT DEFAULT NULL, department_head INT DEFAULT NULL, status INT DEFAULT NULL, remarks VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D649F85E0677 (username), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
        $this->addSql('ALTER TABLE leave_application ADD CONSTRAINT FK_178D3896BEE2E5FA FOREIGN KEY (leavename_id) REFERENCES leavename (id)');
    }

    public function down(Schema $schema) : void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE leave_application DROP FOREIGN KEY FK_178D3896BEE2E5FA');
        $this->addSql('DROP TABLE leave_application');
        $this->addSql('DROP TABLE leavename');
        $this->addSql('DROP TABLE user');
    }
}
