X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=blobdiff_plain;f=database%2Fwiki.sql;h=2ec29f6c624cfd1561acc4f001608fd8cece9f72;hp=1d00c01f2563836e96680c4b60e454377a280da1;hb=de694b768d3bd3a969f88324b44e9e84d851a08f;hpb=a67b5963638a70309738fab3972408fb6729a52b diff --git a/database/wiki.sql b/database/wiki.sql index 1d00c01..2ec29f6 100644 --- a/database/wiki.sql +++ b/database/wiki.sql @@ -7,6 +7,7 @@ CREATE TABLE wiki_pages ( name VARCHAR(255) NOT NULL, namespace TExt NOT NULL REFERENCES wiki_namespaces(namespace) DEFAULT '', textsearch tsvector NOT NULL DEFAULT to_tsvector(''), + time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), UNIQUE(namespace,name) ); @@ -35,6 +36,7 @@ BEGIN WHERE NEW.wprev = wpr.wprev; NEW.textsearch := rec.ts || setweight(to_tsvector(NEW.namespace || ':' || NEW.name), 'A'); + NEW.time = NOW(); return NEW; END; $$ LANGUAGE plpgsql;