Emmanuel BENOîT
e50775ec76
* The main loader script has been updated to generate the list of files it needs to load automatically. As a consequence, files that contained manually-maintained lists of scripts have been removed, and definition directories have been renamed accordingly. * PostgreSQL extension loading and configuration has been moved to a separate script to be loaded automatically in the main transaction. * Data and function definition scripts that had the -data or -functions suffix have been renamed (the suffix is unnecessary). * Unit tests have been reorganised to follow the definition's structure. * Documentation has been improved
57 lines
1.5 KiB
SQL
57 lines
1.5 KiB
SQL
-- LegacyWorlds Beta 6
|
|
-- PostgreSQL database scripts
|
|
--
|
|
-- Preference definitions
|
|
--
|
|
-- Copyright(C) 2004-2010, DeepClone Development
|
|
-- --------------------------------------------------------
|
|
|
|
|
|
--
|
|
-- Preference groups
|
|
--
|
|
CREATE TABLE defs.preference_groups(
|
|
id SERIAL PRIMARY KEY ,
|
|
name VARCHAR(32) NOT NULL ,
|
|
display_id INT NOT NULL
|
|
);
|
|
|
|
CREATE UNIQUE INDEX idx_prefgroups_name
|
|
ON defs.preference_groups (name);
|
|
CREATE INDEX idx_prefgroups_dispname
|
|
ON defs.preference_groups (display_id);
|
|
|
|
ALTER TABLE defs.preference_groups
|
|
ADD CONSTRAINT fk_prefgroups_display
|
|
FOREIGN KEY (display_id) REFERENCES defs.strings;
|
|
|
|
|
|
--
|
|
-- Preference definitions
|
|
--
|
|
CREATE TABLE defs.preference_definitions(
|
|
id SERIAL PRIMARY KEY ,
|
|
group_id INT NOT NULL ,
|
|
name VARCHAR(32) NOT NULL ,
|
|
disp_name_id INT NOT NULL ,
|
|
disp_desc_id INT NOT NULL ,
|
|
java_type VARCHAR( 255 ) NOT NULL ,
|
|
default_value TEXT NOT NULL
|
|
);
|
|
|
|
CREATE INDEX idx_prefdefs_group
|
|
ON defs.preference_definitions (group_id);
|
|
CREATE UNIQUE INDEX idx_prefdefs_name
|
|
ON defs.preference_definitions (name);
|
|
CREATE INDEX idx_prefdefs_dispname
|
|
ON defs.preference_definitions (disp_name_id);
|
|
CREATE INDEX idx_prefdefs_dispdesc
|
|
ON defs.preference_definitions (disp_desc_id);
|
|
|
|
ALTER TABLE defs.preference_definitions
|
|
ADD CONSTRAINT fk_prefdefs_group
|
|
FOREIGN KEY (group_id) REFERENCES defs.preference_groups ,
|
|
ADD CONSTRAINT fk_prefdefs_dispname
|
|
FOREIGN KEY (disp_name_id) REFERENCES defs.strings ,
|
|
ADD CONSTRAINT fk_prefdefs_dispdesc
|
|
FOREIGN KEY (disp_desc_id) REFERENCES defs.strings;
|