gama_api/blank_db.sql
c0de 73d464dfa0 Add Schema definition
This is what I think we need so far for the API. 
User authentiacation will be handled through django. 
Currently there are no secondary keys defined, though this may change in the future
2017-06-01 01:06:40 -05:00

28 lines
573 B
SQL

-- Schema Version 1
CREATE TABLE api_owners (
id serial PRIMARY KEY,
name varchar (512) NOT NULL,
email varchar (256) NOT NULL,
user_id int NOT NULL
);
CREATE TABLE api_apps (
id serial PRIMARY KEY,
owner_id int NOT NULL,
apikey varchar (256) NOT NULL,
name varchar (512) NOT NULL,
description varchar (2048),
website varchar (3000),
callback_uri varchar (3000),
settings text
);
CREATE TABLE api_heartbeat (
id serial PRIMARY KEY,
api_id int NOT NULL,
time_sent bigint NOT NULL,
time_rcvd bigint NOT NULL,
latency numeric (6, 2) NOT NULL,
data text
);