This repository has been archived on 2025-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
lwb6/legacyworlds-server-data/db-structure/parts/030-data/140-status.sql

56 lines
1.2 KiB
MySQL
Raw Normal View History

2018-10-23 09:38:02 +02:00
-- LegacyWorlds Beta 6
-- PostgreSQL database scripts
--
-- System & ticker status
2018-10-23 09:38:02 +02:00
--
-- 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;