From 0f42d985c5c7b9020985d0c2311816e5c580636e Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Thu, 25 Jul 2019 22:30:24 +0200 Subject: [PATCH] feature #3: create stats tables --- resources/sql/migrations/0000-init.down.sql | 3 +++ resources/sql/migrations/0000-init.up.sql | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/resources/sql/migrations/0000-init.down.sql b/resources/sql/migrations/0000-init.down.sql index b2e68a7..544b18d 100644 --- a/resources/sql/migrations/0000-init.down.sql +++ b/resources/sql/migrations/0000-init.down.sql @@ -1,3 +1,6 @@ +-- Stats +drop table if exists resource_view; + -- Extra resources drop table if exists follow_article; drop table if exists follow_constitution; diff --git a/resources/sql/migrations/0000-init.up.sql b/resources/sql/migrations/0000-init.up.sql index 50225ca..8ec5264 100644 --- a/resources/sql/migrations/0000-init.up.sql +++ b/resources/sql/migrations/0000-init.up.sql @@ -264,3 +264,13 @@ create table vote_for_comment_on_constitution foreign key (target_id) references comment_on_constitution (id), foreign key (target_id) references citizen (id) ) inherits (vote); + +-- Stats +create table resource_view +( + id uuid default uuid_generate_v4() not null primary key, + type regclass not null, + created_at timestamptz default now() not null, + created_by_id uuid null references citizen (id), + ip cidr null +); \ No newline at end of file