-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
33 lines (27 loc) · 1.15 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
create role web_anon nologin;
grant web_anon to authenticator;
create role api_user nologin;
grant api_user to authenticator;
create schema auth;
grant usage on schema auth to web_anon, api_user;
grant usage on schema postgres_air to web_anon,api_user;
grant select on all tables in schema postgres_air to web_anon;
grant all on all tables in schema postgres_air to api_user;
grant all on all sequences in schema postgres_air to api_user;
create schema main;
grant usage on schema main to web_anon,api_user;
grant select on main to web_anon;
grant all on main to api_user;
create table main.todos (
id serial primary key,
done boolean not null default false,
task text not null,
due timestamptz
);
SET search_path TO postgres_air;
CREATE INDEX flight_departure_airport ON flight(departure_airport);
CREATE INDEX flight_scheduled_departure ON postgres_air.flight (scheduled_departure);
CREATE INDEX flight_update_ts ON postgres_air.flight (update_ts);
CREATE INDEX booking_leg_booking_id ON postgres_air.booking_leg (booking_id);
CREATE INDEX booking_leg_update_ts ON postgres_air.booking_leg (update_ts);
CREATE INDEX account_last_name ON account (last_name);