-
Notifications
You must be signed in to change notification settings - Fork 2
DB Schema
CREATE TABLE records ( user_id INTEGER NOT NULL, age INTEGER, height INTEGER, weight INTEGER, cholesterol INTEGER, blood_pressure INTEGER, tip_sent INTEGER, number_of_cysts integer, baldness integer, baldness_from_disease integer, FOREIGN KEY(user_id) REFERENCES users(ROWID) );
CREATE TABLE auth_tokens ( api_user INTEGER NOT NULL, api_key text NOT NULL, FOREIGN KEY(api_user) REFERENCES users(ROWID) );
CREATE TABLE users ( email text NOT NULL, first_name text NOT NULL, last_name text NOT NULL, password text NOT NULL , last_tip_epoch INTEGER NULL);
CREATE TABLE insurance_companies ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL); CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE procedures ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL);
CREATE TABLE files ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, content BLOB NOT NULL);
CREATE TABLE medical_policies ( company_id INTEGER NOT NULL, procedure_id INTEGER NOT NULL, file_id INTEGER NOT NULL, conditional_approval INTEGER, FOREIGN KEY(company_id) REFERENCES insurance_companies(id), FOREIGN KEY(procedure_id) REFERENCES procedures(id), FOREIGN KEY(file_id) REFERENCES files(id));