|
| 1 | +CREATE TABLE public.countries ( |
| 2 | + id int8 PRIMARY KEY, |
| 3 | + iso CHAR (2) NOT NULL, |
| 4 | + country_name VARCHAR (80) NOT NULL, |
| 5 | + nicename VARCHAR (80) NOT NULL, |
| 6 | + iso3 CHAR (3) DEFAULT NULL, |
| 7 | + numcode SMALLINT DEFAULT NULL, |
| 8 | + phonecode INT NOT NULL |
| 9 | +); |
| 10 | + |
| 11 | +INSERT INTO public.countries (id, iso, country_name, nicename, iso3, numcode, phonecode) VALUES |
| 12 | + (1, 'AF', 'AFGHANISTAN', 'Afghanistan', 'AFG', 4, 93), |
| 13 | + (2, 'AL', 'ALBANIA', 'Albania', 'ALB', 8, 355), |
| 14 | + (3, 'DZ', 'ALGERIA', 'Algeria', 'DZA', 12, 213), |
| 15 | + (4, 'AQ', 'ANTARCTICA', 'Antarctica', NULL, NULL, 0), |
| 16 | + (5, 'CR', 'COSTA RICA', 'Costa Rica', 'CRI', 188, 506), |
| 17 | + (6, 'ES', 'SPAIN', 'Spain', 'ESP', 724, 34), |
| 18 | + (7, 'TH', 'THAILAND', 'Thailand', 'THA', 764, 66), |
| 19 | + (8, 'TG', 'TOGO', 'Togo', 'TGO', 768, 228), |
| 20 | + (9, 'TT', 'TRINIDAD AND TOBAGO', 'Trinidad and Tobago', 'TTO', 780, 1868), |
| 21 | + (10, 'GB', 'UNITED KINGDOM', 'United Kingdom', 'GBR', 826, 44), |
| 22 | + (11, 'US', 'UNITED STATES', 'United States', 'USA', 840, 1), |
| 23 | + (12, 'ZW', 'ZIMBABWE', 'Zimbabwe', 'ZWE', 716, 263); |
| 24 | + |
| 25 | +create table public.cities ( |
| 26 | + id int8 primary key, |
| 27 | + country_id int8 not null references public.countries, |
| 28 | + name text |
| 29 | +); |
| 30 | + |
| 31 | +insert into public.cities (id, name, country_id) values |
| 32 | + (1, 'London', 10), |
| 33 | + (2, 'Manchester', 10), |
| 34 | + (3, 'Liverpool', 10), |
| 35 | + (4, 'Bristol', 10), |
| 36 | + (5, 'Miami', 11), |
| 37 | + (6, 'Huston', 11), |
| 38 | + (7, 'Atlanta', 11); |
| 39 | + |
| 40 | +create table public.users ( |
| 41 | + id int8 primary key, |
| 42 | + name text, |
| 43 | + address jsonb |
| 44 | +); |
| 45 | + |
| 46 | +insert into public.users (id, name, address) values |
| 47 | + (1, 'Michael', '{ "postcode": 90210, "street": "Melrose Place" }'), |
| 48 | + (2, 'Jane', '{}'); |
| 49 | + |
| 50 | +create table public.reservations ( |
| 51 | + id int8 primary key, |
| 52 | + room_name text, |
| 53 | + during tsrange |
| 54 | +); |
| 55 | + |
| 56 | +insert into public.reservations (id, room_name, during) values |
| 57 | + (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'), |
| 58 | + (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)'); |
| 59 | + |
| 60 | + |
| 61 | +create table public.issues ( |
| 62 | + id int8 primary key, |
| 63 | + title text, |
| 64 | + tags text[] |
| 65 | +); |
| 66 | + |
| 67 | +insert into public.issues (id, title, tags) values |
| 68 | + (1, 'Cache invalidation is not working', array['is:open', 'severity:high', 'priority:low']), |
| 69 | + (2, 'Use better names', array['is:open', 'severity:low', 'priority:medium']), |
| 70 | + (3, 'Add missing postgrest filters', array['is:open', 'severity:low', 'priority:high']), |
| 71 | + (4, 'Add alias to filters', array['is:closed', 'severity:low', 'priority:medium']); |
0 commit comments