Skip to content

Commit 3b8c748

Browse files
committed
Add statistics table to schema
1 parent e9cdbfb commit 3b8c748

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

src/commonMain/resources/schema.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
-- drop table software_;
77
-- drop table file_;
88
-- drop table storage_;
9+
-- drop table statistics;
10+
-- drop sequence statistics_id_seq;
911

1012

1113
create table software_
@@ -42,6 +44,19 @@ create table event
4244
-- primary_vertex bool not null
4345
);
4446

47+
CREATE TABLE statistics (
48+
json_stats character varying NOT NULL,
49+
id integer NOT NULL,
50+
time_written time without time zone
51+
);
52+
53+
CREATE SEQUENCE statistics_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
54+
55+
ALTER TABLE ONLY statistics ALTER COLUMN id SET DEFAULT nextval('statistics_id_seq'::regclass);
56+
57+
ALTER TABLE ONLY statistics ADD CONSTRAINT statistics_pkey PRIMARY KEY (id);
58+
59+
4560
-- create table bmn_event
4661
-- (
4762
-- file_guid int not null references file_(file_guid) on update cascade,

testing/docker-ems-catalogue/schema.sql

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
-- drop table software_;
77
-- drop table file_;
88
-- drop table storage_;
9-
9+
-- drop table statistics;
10+
-- drop sequence statistics_id_seq;
1011

1112
create table software_
1213
(
@@ -69,3 +70,15 @@ create table test_event
6970
trigger_str varchar (30) not null,
7071
primary_vertex bool not null
7172
);
73+
74+
CREATE TABLE statistics (
75+
json_stats character varying NOT NULL,
76+
id integer NOT NULL,
77+
time_written time without time zone
78+
);
79+
80+
CREATE SEQUENCE statistics_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
81+
82+
ALTER TABLE ONLY statistics ALTER COLUMN id SET DEFAULT nextval('statistics_id_seq'::regclass);
83+
84+
ALTER TABLE ONLY statistics ADD CONSTRAINT statistics_pkey PRIMARY KEY (id);

0 commit comments

Comments
 (0)