47 lines
1.3 KiB
SQL
Executable File
47 lines
1.3 KiB
SQL
Executable File
-- # $Id$
|
|
-- # $HeadURL$
|
|
-- # $Author$
|
|
|
|
\set ON_ERROR_STOP
|
|
|
|
-- Create User for ex 35
|
|
SELECT create_user_if_not_exists('ets_ex_00');
|
|
|
|
-- Schema ex_35
|
|
CREATE SCHEMA IF NOT EXISTS ex_35;
|
|
ALTER SCHEMA ex_35 OWNER TO ets_exm;
|
|
GRANT USAGE ON SCHEMA ex_35 TO ets_ro;
|
|
GRANT ALL ON SCHEMA ex_35 TO ets_admin;
|
|
|
|
-- Create User for ex 42
|
|
-- SELECT create_user_if_not_exists('ets_ex_00');
|
|
|
|
-- Schema ex_42
|
|
CREATE SCHEMA IF NOT EXISTS ex_42;
|
|
ALTER SCHEMA ex_42 OWNER TO ets_exm;
|
|
GRANT USAGE ON SCHEMA ex_42 TO ets_ro;
|
|
GRANT ALL ON SCHEMA ex_42 TO ets_admin;
|
|
|
|
-- table db_version
|
|
SET SEARCH_PATH TO ex_35;
|
|
CREATE TABLE IF NOT EXISTS db_version (
|
|
id serial,
|
|
description text,
|
|
version text,
|
|
updated bigint DEFAULT (extract(epoch from now()) * 1000),
|
|
success boolean DEFAULT true,
|
|
message text
|
|
);
|
|
-- INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
|
|
|
|
SET SEARCH_PATH TO ex_42;
|
|
CREATE TABLE IF NOT EXISTS db_version (
|
|
id serial,
|
|
description text,
|
|
version text,
|
|
updated bigint DEFAULT (extract(epoch from now()) * 1000),
|
|
success boolean DEFAULT true,
|
|
message text
|
|
);
|
|
-- INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
|