]> ruin.nu Git - ndwebbie.git/commitdiff
Good to have time if we want to list most recent changes
authorMichael Andreen <harv@ruin.nu>
Wed, 13 Aug 2008 13:25:09 +0000 (15:25 +0200)
committerMichael Andreen <harv@ruin.nu>
Wed, 13 Aug 2008 13:25:09 +0000 (15:25 +0200)
database/wiki.sql

index 1d00c01f2563836e96680c4b60e454377a280da1..2ec29f6c624cfd1561acc4f001608fd8cece9f72 100644 (file)
@@ -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;