Project: * Clean-up (Eclipse cruft, unused files, etc...) * Git-specific changes * Maven POMs clean-up and changes for the build system * Version set to 1.0.0-0 in the development branches * Maven plug-ins updated to latest versions * Very partial dev. documentation added
This commit is contained in:
parent
c74e30d5ba
commit
0665a760de
1439 changed files with 1020 additions and 1649 deletions
legacyworlds-server-data/db-structure
54
legacyworlds-server-data/db-structure/database.sql
Normal file
54
legacyworlds-server-data/db-structure/database.sql
Normal file
|
@ -0,0 +1,54 @@
|
|||
-- LegacyWorlds Beta 6
|
||||
-- PostgreSQL database scripts
|
||||
--
|
||||
-- Main database script
|
||||
--
|
||||
-- Initialises the various roles and the database itself,
|
||||
-- then processes scripts from the "parts" directory.
|
||||
--
|
||||
-- Copyright(C) 2004-2010, DeepClone Development
|
||||
-- --------------------------------------------------------
|
||||
|
||||
-- Read configuration from file
|
||||
\set pgadmin `grep ^admin= db-config.txt | sed -e s/.*=//`
|
||||
\set dbname `grep ^db= db-config.txt | sed -e s/.*=//`
|
||||
\set dbuser `grep ^user= db-config.txt | sed -e s/.*=//`
|
||||
\set dbupass ''''`grep ^password= db-config.txt | sed -e s/.*=// -e "s/'/''/g"`''''
|
||||
|
||||
|
||||
-- Connect to the main system database
|
||||
\c postgres :pgadmin
|
||||
|
||||
-- Drop the database and users if they exist
|
||||
DROP DATABASE IF EXISTS :dbname;
|
||||
DROP ROLE IF EXISTS :dbuser;
|
||||
|
||||
-- Create the LW users
|
||||
CREATE ROLE :dbuser WITH LOGIN ENCRYPTED PASSWORD :dbupass;
|
||||
|
||||
-- Create the database
|
||||
CREATE DATABASE :dbname ENCODING='UTF8' TEMPLATE=template0;
|
||||
GRANT CONNECT ON DATABASE :dbname TO :dbuser;
|
||||
|
||||
|
||||
-- Connect to the LW database with the PostgreSQL admin user
|
||||
\c :dbname :pgadmin
|
||||
|
||||
-- Register PL/PgSQL
|
||||
CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql;
|
||||
|
||||
BEGIN;
|
||||
|
||||
-- Create database schemas
|
||||
\i parts/000-schemas.sql
|
||||
|
||||
-- Process structure definition scripts
|
||||
\i parts/010-data.sql
|
||||
|
||||
-- Process functions and views definition scripts
|
||||
\i parts/020-functions.sql
|
||||
|
||||
-- Process game update functions
|
||||
\i parts/030-updates.sql
|
||||
|
||||
COMMIT;
|
Reference in a new issue