schema fixes
This commit is contained in:
parent
50a8254df8
commit
5ec9e2379c
2 changed files with 4 additions and 4 deletions
|
|
@ -25,7 +25,7 @@ CREATE TABLE host_config (
|
|||
PRIMARY KEY (create_event, host_id),
|
||||
UNIQUE (host_id, active)
|
||||
) WITHOUT OIDS;
|
||||
CREATE INDEX host_config_by_active_and_enabled ON host_config(active, enabled)
|
||||
CREATE INDEX host_config_by_active_and_enabled ON host_config(active, enabled);
|
||||
|
||||
-- copy starting data
|
||||
-- CREATE FUNCTION pg_temp.user() returns INTEGER as $$ select id from users where name='nobody' $$ language SQL;
|
||||
|
|
@ -46,7 +46,7 @@ ALTER TABLE host DROP COLUMN comment;
|
|||
ALTER TABLE host DROP COLUMN enabled;
|
||||
|
||||
-- history for host_channels
|
||||
SELECT 'Adding versions to host_channels'
|
||||
SELECT 'Adding versions to host_channels';
|
||||
ALTER TABLE host_channels ADD COLUMN create_event INTEGER NOT NULL REFERENCES events(id) DEFAULT get_event();
|
||||
ALTER TABLE host_channels ADD COLUMN revoke_event INTEGER REFERENCES events(id);
|
||||
-- we need some default for alter table, but drop it after
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ CREATE TABLE host (
|
|||
user_id INTEGER NOT NULL REFERENCES users (id),
|
||||
name VARCHAR(128) UNIQUE NOT NULL,
|
||||
task_load FLOAT CHECK (NOT task_load < 0) NOT NULL DEFAULT 0.0,
|
||||
ready BOOLEAN NOT NULL DEFAULT 'false',
|
||||
ready BOOLEAN NOT NULL DEFAULT 'false'
|
||||
) WITHOUT OIDS;
|
||||
|
||||
CREATE TABLE host_config (
|
||||
|
|
@ -168,7 +168,7 @@ CREATE TABLE host_config (
|
|||
PRIMARY KEY (create_event, host_id),
|
||||
UNIQUE (host_id, active)
|
||||
) WITHOUT OIDS;
|
||||
CREATE INDEX host_config_by_active_and_enabled ON host_config(active, enabled)
|
||||
CREATE INDEX host_config_by_active_and_enabled ON host_config(active, enabled);
|
||||
|
||||
CREATE TABLE host_channels (
|
||||
host_id INTEGER NOT NULL REFERENCES host(id),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue