This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb6/legacyworlds-server/legacyworlds-server-data/db-structure/parts/data/020-prefs-data.sql

58 lines
1.5 KiB
MySQL
Raw Normal View History

2018-10-23 09:38:02 +02:00
-- 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;