Select Git revision
schema.sql 1.08 KiB
drop table if exists "user" cascade;
drop table if exists mobil_data cascade;
drop table if exists process cascade;
drop sequence if exists hibernate_sequence;
create sequence hibernate_sequence start 1 increment 1;
create table "user" (
id int8 not null,
email varchar(255),
password varchar(255),
token varchar(255),
android_version INTEGER,
birth_date TIMESTAMP,
device_type VARCHAR(255),
primary key (id)
);
create table process (
id int8 not null,
user_id int8 not null,
process VARCHAR(255)
);
create table mobil_data (
id int8 not null,
user_id int8 not null,
location_lat DOUBLE PRECISION,
location_long DOUBLE PRECISION,
battery INTEGER,
brightness INTEGER,
wifi_on BOOLEAN,
mobil_data_on BOOLEAN,
bluetooth_on BOOLEAN,
nfc_on BOOLEAN,
sleep_time INTEGER,
battery_temp DOUBLE PRECISION,
mobile_data_usage INTEGER,
wifi_data_usage INTEGER,
actual_time TIMESTAMP not null,
is_charging BOOLEAN
);
alter table mobil_data
add CONSTRAINT user_id_foreign_key
FOREIGN KEY ("user_id")
REFERENCES "user"
-- TODO process foreign key