apskel-pos-backend/migrations/000001_create_organizations_table.up.sql

14 lines
538 B
MySQL
Raw Normal View History

2025-07-18 20:10:29 +07:00
-- Organizations table
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE organizations (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL,
plan_type VARCHAR(50) NOT NULL CHECK (plan_type IN ('basic', 'premium', 'enterprise')),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Indexes
CREATE INDEX idx_organizations_plan_type ON organizations(plan_type);
CREATE INDEX idx_organizations_created_at ON organizations(created_at);