-- +goose Up
-- Create opcs table for OPC (Operation Planning Center) master data

CREATE TABLE IF NOT EXISTS opcs (
  id BINARY(16) NOT NULL PRIMARY KEY,
  name VARCHAR(64) NOT NULL UNIQUE,
  description VARCHAR(255) NULL,
  created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  created_by BINARY(16) NULL,
  updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  updated_by BINARY(16) NULL,
  deleted_at DATETIME NULL,
  deleted_by BINARY(16) NULL,

  KEY idx_opcs_name (name),
  KEY idx_opcs_deleted_at (deleted_at)
);

-- +goose Down
DROP TABLE IF EXISTS opcs;
