From 8e96edca8659bc87cd85072741e6db8aeaf751ff Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Tue, 4 Feb 2020 06:20:25 -0500 Subject: Add raw data to database --- migrations/2020-02-03-225040_tasks/down.sql | 1 + migrations/2020-02-03-225040_tasks/up.sql | 7 +++++++ migrations/2020-02-04-105747_raw_data/down.sql | 1 + migrations/2020-02-04-105747_raw_data/up.sql | 8 ++++++++ 4 files changed, 17 insertions(+) create mode 100644 migrations/2020-02-03-225040_tasks/down.sql create mode 100644 migrations/2020-02-03-225040_tasks/up.sql create mode 100644 migrations/2020-02-04-105747_raw_data/down.sql create mode 100644 migrations/2020-02-04-105747_raw_data/up.sql (limited to 'migrations') diff --git a/migrations/2020-02-03-225040_tasks/down.sql b/migrations/2020-02-03-225040_tasks/down.sql new file mode 100644 index 0000000..4827072 --- /dev/null +++ b/migrations/2020-02-03-225040_tasks/down.sql @@ -0,0 +1 @@ +drop table tasks; diff --git a/migrations/2020-02-03-225040_tasks/up.sql b/migrations/2020-02-03-225040_tasks/up.sql new file mode 100644 index 0000000..faebc0a --- /dev/null +++ b/migrations/2020-02-03-225040_tasks/up.sql @@ -0,0 +1,7 @@ +create table tasks ( + id bigserial not null primary key, + state varchar(8) not null, + start_at timestamptz not null, + username varchar not null references users(username), + payload jsonb not null +); diff --git a/migrations/2020-02-04-105747_raw_data/down.sql b/migrations/2020-02-04-105747_raw_data/down.sql new file mode 100644 index 0000000..fbfd854 --- /dev/null +++ b/migrations/2020-02-04-105747_raw_data/down.sql @@ -0,0 +1 @@ +drop table raw_data; diff --git a/migrations/2020-02-04-105747_raw_data/up.sql b/migrations/2020-02-04-105747_raw_data/up.sql new file mode 100644 index 0000000..386ba84 --- /dev/null +++ b/migrations/2020-02-04-105747_raw_data/up.sql @@ -0,0 +1,8 @@ +create table raw_data( + data_type varchar(8) not null, + id bigint not null, + username varchar not null references users(username), + payload jsonb, + + primary key(data_type, id) +); -- cgit v1.2.3