diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-04-18 00:53:11 +0100 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-04-18 00:53:11 +0100 |
| commit | fa6074eaf52be4254c17b74f20193aa96c940df8 (patch) | |
| tree | 56385615fe86dbb5ab7ce4a90d696d97ddf21d7e | |
| parent | a6d31ff1d8703eae9375b7ec1cd01b323d7e8e6e (diff) | |
| download | webstat-fa6074eaf52be4254c17b74f20193aa96c940df8.tar.bz2 webstat-fa6074eaf52be4254c17b74f20193aa96c940df8.tar.xz webstat-fa6074eaf52be4254c17b74f20193aa96c940df8.zip | |
Swap int for integer in schema
Plays better with apgdiff
| -rw-r--r-- | src/schema.sql | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/schema.sql b/src/schema.sql index fd9eb4f..b211505 100644 --- a/src/schema.sql +++ b/src/schema.sql @@ -33,7 +33,7 @@ CREATE TYPE entity AS ENUM( ); CREATE TABLE entities( - id int GENERATED ALWAYS AS IDENTITY, + id integer GENERATED ALWAYS AS IDENTITY, value text NOT NULL, type entity NOT NULL, detail jsonb, @@ -43,11 +43,11 @@ CREATE TABLE entities( CREATE UNIQUE INDEX uni_entities_value ON entities(MD5(value)); CREATE OR REPLACE FUNCTION entity(newValue text, newType entity) - RETURNS int + RETURNS integer AS $$ DECLARE now timestamp without time zone; - recid int; + recid integer; BEGIN IF newValue IS NULL THEN RETURN NULL; @@ -83,20 +83,20 @@ RETURNS NULL ON NULL INPUT; CREATE TABLE access_log( id bigint GENERATED ALWAYS AS IDENTITY, - hostname int NOT NULL, - virtual_host int NOT NULL, + hostname integer NOT NULL, + virtual_host integer NOT NULL, remoteip inet NOT NULL, request_time timestamp(6) NOT NULL, method http_verb NOT NULL, protocol protocol NOT NULL, - path int NOT NULL, - query_string int, + path integer NOT NULL, + query_string integer, status smallint NOT NULL, - size int NOT NULL, + size integer NOT NULL, duration interval second(6) NOT NULL, - referrer int, - user_agent int, - content_type int, + referrer integer, + user_agent integer, + content_type integer, CONSTRAINT pk_access_log PRIMARY KEY (id), CONSTRAINT fk_access_log_hostname FOREIGN KEY (hostname) REFERENCES entities(id) ON UPDATE CASCADE, CONSTRAINT fk_access_log_virtualhost FOREIGN KEY (virtual_host) REFERENCES entities(id) ON UPDATE CASCADE, |
