-- Migration: 001_init
-- Created by: kegani init
-- Description: Initial schema

CREATE TABLE IF NOT EXISTS {{RESOURCE_NAME}} (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    name VARCHAR(255) NOT NULL,
    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

-- Indexes
CREATE INDEX IF NOT EXISTS idx_{{RESOURCE_NAME}}_name ON {{RESOURCE_NAME}}(name);
CREATE INDEX IF NOT EXISTS idx_{{RESOURCE_NAME}}_created_at ON {{RESOURCE_NAME}}(created_at);

-- Rollback
-- DROP TABLE IF EXISTS {{RESOURCE_NAME}};