1111
This commit is contained in:
43
infra/init/010-target.sql
Normal file
43
infra/init/010-target.sql
Normal file
@@ -0,0 +1,43 @@
|
||||
create extension if not exists "pgcrypto";
|
||||
|
||||
create table if not exists finance__invoices (
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
customer_name text not null,
|
||||
amount numeric(12,2) not null,
|
||||
status text not null default 'draft',
|
||||
created_at timestamptz not null default now()
|
||||
);
|
||||
|
||||
create table if not exists users__accounts (
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
email text not null unique,
|
||||
full_name text not null,
|
||||
is_active boolean not null default true,
|
||||
created_at timestamptz not null default now()
|
||||
);
|
||||
|
||||
create table if not exists logs__events (
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
source text not null,
|
||||
level text not null,
|
||||
message text not null,
|
||||
created_at timestamptz not null default now()
|
||||
);
|
||||
|
||||
insert into finance__invoices (customer_name, amount, status)
|
||||
values
|
||||
('Acme Corp', 1200.50, 'paid'),
|
||||
('Northwind', 340.00, 'draft')
|
||||
on conflict do nothing;
|
||||
|
||||
insert into users__accounts (email, full_name, is_active)
|
||||
values
|
||||
('root@example.com', 'Root Operator', true),
|
||||
('analyst@example.com', 'Financial Analyst', true)
|
||||
on conflict do nothing;
|
||||
|
||||
insert into logs__events (source, level, message)
|
||||
values
|
||||
('system', 'info', 'Bootstrap completed'),
|
||||
('postgres', 'warn', 'Autovacuum threshold reached')
|
||||
on conflict do nothing;
|
||||
Reference in New Issue
Block a user