Files
leocrm/app/plugins/builtins/test_sample/migrations/0001_test_plugin.sql
T

10 lines
411 B
SQL
Raw Normal View History

-- Test sample plugin migration: creates a test table with tenant_id
CREATE TABLE IF NOT EXISTS test_sample_items (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id UUID NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
name VARCHAR(100) NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS ix_test_sample_items_tenant ON test_sample_items(tenant_id);