Files
HKSingleParty/99_references/supabase-examples/enterprise-patterns/partitions/supabase/migrations/20000101003626_customers.sql
2025-05-28 09:55:51 +08:00

21 lines
470 B
SQL

-- Create the partitioned table
create table customers (
id bigint generated by default as identity,
name text,
country text,
-- We need to include all the
-- partitioning columns in constraints:
primary key (country, id)
)
partition by list(country);
create table customers_americas
partition of customers
for values in ('US', 'CANADA');
create table customers_asia
partition of customers
for values in ('INDIA', 'CHINA', 'JAPAN');