mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 09:51:59 +03:00
f72d8de87a
* fix insert fails for non-admin roles on v1/query, fix #327 * add test case for user role upsert usint constraint name
69 lines
1.7 KiB
YAML
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
|
|
)
|