feature #3: create stats tables

This commit is contained in:
2019-07-25 22:30:24 +02:00
parent 899bae4a1d
commit 0f42d985c5
2 changed files with 13 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
-- Stats
drop table if exists resource_view;
-- Extra resources -- Extra resources
drop table if exists follow_article; drop table if exists follow_article;
drop table if exists follow_constitution; drop table if exists follow_constitution;

View File

@@ -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 comment_on_constitution (id),
foreign key (target_id) references citizen (id) foreign key (target_id) references citizen (id)
) inherits (vote); ) 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
);