Emmanuel BENOîT
56eddcc4f0
* Added a set of tables which define game updates and their targets. These definitions replace the old enumerate type. Added a set of triggers which automatically create specific update tables, insert missing entries, etc... when game update types are being manipulated. * Removed manual insertion of game updates from empire creation function and universe generator. * Added registration of core update targets (i.e. planets and empires), updated all existing game update processing functions and added type registrations * Created Maven project for game updates control components, moved existing components from the -simple project, rewritten most of what they contained, added new components for server-side update batch processing
55 lines
1.2 KiB
SQL
55 lines
1.2 KiB
SQL
-- LegacyWorlds Beta 6
|
|
-- PostgreSQL database scripts
|
|
--
|
|
-- System & ticker status
|
|
--
|
|
-- Copyright(C) 2004-2010, DeepClone Development
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- System status
|
|
--
|
|
CREATE TABLE sys.status(
|
|
next_tick BIGINT NOT NULL
|
|
DEFAULT 0 ,
|
|
current_tick BIGINT ,
|
|
|
|
last_msg_recap TIMESTAMP WITHOUT TIME ZONE
|
|
NOT NULL
|
|
DEFAULT now( ) ,
|
|
last_admin_recap TIMESTAMP WITHOUT TIME ZONE
|
|
NOT NULL
|
|
DEFAULT now( ) ,
|
|
last_error_recap TIMESTAMP WITHOUT TIME ZONE
|
|
NOT NULL
|
|
DEFAULT now( ) ,
|
|
|
|
maintenance_start TIMESTAMP WITHOUT TIME ZONE ,
|
|
maintenance_end TIMESTAMP WITHOUT TIME ZONE ,
|
|
maintenance_text TEXT
|
|
);
|
|
|
|
INSERT INTO sys.status DEFAULT VALUES;
|
|
|
|
GRANT SELECT ON sys.status TO :dbuser;
|
|
|
|
|
|
|
|
--
|
|
-- Ticker status
|
|
--
|
|
|
|
CREATE TYPE ticker_task_status
|
|
AS ENUM( 'RUNNING' , 'STOPPED' , 'AUTO' );
|
|
|
|
CREATE TABLE sys.ticker(
|
|
id SERIAL PRIMARY KEY ,
|
|
task_name VARCHAR(64) NOT NULL UNIQUE ,
|
|
status ticker_task_status NOT NULL ,
|
|
auto_start TIMESTAMP WITHOUT TIME ZONE
|
|
);
|
|
|
|
INSERT INTO sys.ticker( task_name , status )
|
|
VALUES ( 'Game update' , 'STOPPED' );
|
|
|
|
GRANT SELECT ON sys.ticker TO :dbuser;
|