import { Migration } from '../migrate.js'

export const up: Migration['up'] = async (db) => {
  await db.query(`
    CREATE TABLE IF NOT EXISTS workflows (
      id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
      name VARCHAR(255) NOT NULL,
      definition JSONB NOT NULL,
      status VARCHAR(50) DEFAULT 'DRAFT',
      created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
      updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
    )
  `)
}

export const down: Migration['down'] = async (db) => {
  await db.query(`DROP TABLE IF EXISTS workflows`)
}

