mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-30 10:54:50 +03:00
5bc0355bdd
GitOrigin-RevId: abd7303aaf8e7a8739fd10574249aec450082ef8
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
type: bulk
|
|
args:
|
|
|
|
|
|
- type: run_sql
|
|
args:
|
|
sql: |
|
|
CREATE TABLE colors
|
|
( value text PRIMARY KEY
|
|
, comment text );
|
|
INSERT INTO colors (value, comment) VALUES
|
|
('red', '#FF0000'),
|
|
('green', '#00FF00'),
|
|
('blue', '#0000FF'),
|
|
('orange', '#FFFF00'),
|
|
('yellow', '#00FFFF'),
|
|
('purple', '#FF00FF');
|
|
|
|
CREATE TABLE weekdays
|
|
( value text PRIMARY KEY );
|
|
INSERT INTO weekdays (value) VALUES
|
|
('sunday'),
|
|
('monday'),
|
|
('tuesday'),
|
|
('wednesday'),
|
|
('thursday'),
|
|
('friday'),
|
|
('saturday');
|
|
|
|
CREATE TABLE employees
|
|
( id serial PRIMARY KEY
|
|
, name text NOT NULL
|
|
, favorite_color text NOT NULL REFERENCES colors
|
|
, gets_paid_on text NOT NULL REFERENCES weekdays );
|
|
INSERT INTO employees (name, favorite_color, gets_paid_on) VALUES
|
|
('Alyssa', 'red', 'monday'),
|
|
('Ben', 'blue', 'friday');
|
|
|
|
- type: track_table
|
|
args:
|
|
table: colors
|
|
is_enum: true
|
|
- type: track_table
|
|
args: weekdays
|
|
- type: track_table
|
|
args: employees
|