All pastes #232851 Raw Edit

phoemix

public sql v1 · immutable
·published 2006-11-01 16:20 UTC
rendered paste body
CREATE SEQUENCE "buildingroles_id_seq";CREATE TABLE "buildingroles" (        "id"            integer         NOT NULL        DEFAULT nextval('csvdevel.buildingroles_id_seq'),        "name"          varchar(128)    NOT NULL        UNIQUE,        "colonycenter"  boolean         NOT NULL        DEFAULT false,        PRIMARY KEY     ("id"));CREATE SEQUENCE "buildigs_id_seq";CREATE TABLE "buildings" (        "id"            integer         NOT NULL        DEFAULT nextval('csvdevel.buildings_id_seq'),        "roleid"        integer         NOT NULL,        "name"          varchar(256)    NOT NULL        UNIQUE,        "description"   text            NOT NULL,        "upkeep"        int8            NOT NULL,        "moraleffect"   real            NOT NULL        DEFAULT 0,        "defpriority"   integer         NOT NULL        UNIQUE,        "structure"     integer         NOT NULL        DEFAULT 100,        "startwith"     integer         NOT NULL        DEFAULT 0,        "workers"       integer         NOT NULL,        "powerneed"     integer         NOT NULL,        "space"         integer         NOT NULL,-- from here, BCNF should be used...        "accomondate"   integer         NOT NULL        DEFAULT 0,        "military_accom"        integer NOT NULL        DEFAULT 0,        "poweroutput"   integer         NOT NULL        DEFAULT 0,        "buildoutput"   integer         NOT NULL        DEFAULT 0,        "researchoutput"        integer NOT NULL        DEFAULT 0,        "storage"       integer         NOT NULL        DEFAULT 0,        PRIMARY KEY     ("id"),        FOREIGN KEY     ("roleid")      REFERENCES      "buildingrules"("id"),        CONSTRAINT "buildings_structure_chk"    CHECK ("structure">0));