<?php

use Phalcon\Mvc\Model\Migration;

class StranasSnapshotMasterMigration_399 extends Migration {
    public function up() {
        return; // migrasi dibatalkan
        self::$connection->execute("
            DROP TABLE if exists jaga.str_snapshot_master;
            CREATE TABLE jaga.str_snapshot_master
            (
                id integer NOT NULL,
                id_target integer NOT NULL,
                id_instansi integer NOT NULL,
                klaim integer,
                nilai integer,
                UNIQUE(id, id_target, id_instansi),
                CONSTRAINT str_snapshot_master_id_fkey
                    FOREIGN KEY (id)
                        REFERENCES jaga.str_snapshot(id),
                CONSTRAINT str_snapshot_master_idtarget_fkey
                    FOREIGN KEY (id_target)
                    REFERENCES jaga.str_target(id),
                CONSTRAINT str_snapshot_master_idinstansi_fkey
                    FOREIGN KEY (id_instansi)
                    REFERENCES jaga.instansi(id)
            );
        ");
    }

    public function down() {
        return; // migrasi dibatalkan
        self::$connection->execute("
            DROP TABLE if exists jaga.str_snapshot_master;
        ");
    }
}