graphql-engine/server/test/testcases/create_tables.yaml
Rakesh Emmadi f72d8de87a fix insert fails for non-admin roles on v1/query (fix #327) (#328)
* fix insert fails for non-admin roles on v1/query, fix #327

* add test case for user role upsert usint constraint name
2018-08-29 19:11:33 +05:30

69 lines
1.7 KiB
YAML

description: Runs a bulk SQL query to create tables
url: /v1/query
status: 200
query:
type: bulk
args:
- type: run_sql
args:
sql: "CREATE TABLE author (id SERIAL PRIMARY KEY, name TEXT UNIQUE)"
- type: run_sql
args:
sql: |
CREATE TABLE article (
id SERIAL PRIMARY KEY,
title TEXT,
content TEXT,
author_id INTEGER REFERENCES author(id),
is_published BOOLEAN,
published_on TIMESTAMP
)
- type: run_sql
args:
sql: |
CREATE TABLE person (
id SERIAL PRIMARY KEY,
details JSONB NOT NULL
)
- type: run_sql
args:
sql: |
CREATE TABLE dollar$test (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL
)
- type: run_sql
args:
sql: |
CREATE TABLE resident (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
age INTEGER NOT NULL
)
- type: run_sql
args:
sql: |
CREATE TABLE address (
id SERIAL PRIMARY KEY,
door_no TEXT NOT NULL,
street TEXT NOT NULL,
city TEXT NOT NULL,
resident_id INTEGER REFERENCES resident(id)
)
- type: run_sql
args:
sql: |
CREATE TABLE orders (
id SERIAL PRIMARY KEY,
placed TIMESTAMPTZ NOT NULL,
shipped TIMESTAMPTZ
)
- type: run_sql
args:
sql: |
CREATE TABLE test_table (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
age INTEGER NOT NULL
)