phase 0.3
This commit is contained in:
commit
4a94bfc4e7
52 changed files with 11653 additions and 0 deletions
33
sql/migrations/004_central_dispatch.sql
Normal file
33
sql/migrations/004_central_dispatch.sql
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
-- Migration 004: central-port dispatch + NPC factions + unload lifecycle
|
||||
-- Run once against an existing skyrama_clone database.
|
||||
-- Row seeding (NPC users, hub countries, central airports, factions) is done
|
||||
-- idempotently in Go by Client.EnsureStage0World() at startup, not here.
|
||||
|
||||
-- Central ports are system-owned (faction NPC) airports, one per continent.
|
||||
ALTER TABLE airports
|
||||
ADD COLUMN is_central BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
-- NPC faction-leader users: cannot log in (empty password_hash), hidden from
|
||||
-- login + user lists.
|
||||
ALTER TABLE users
|
||||
ADD COLUMN is_npc BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
-- Where a dispatched plane is flying to, plus a post-landing 'unloading' phase.
|
||||
ALTER TABLE player_planes
|
||||
MODIFY COLUMN status ENUM('idle','maintenance','boarding','taxiing','flying','unloading') NOT NULL DEFAULT 'idle',
|
||||
ADD COLUMN destination_airport_id INT UNSIGNED DEFAULT NULL,
|
||||
ADD FOREIGN KEY (destination_airport_id) REFERENCES airports(id);
|
||||
|
||||
-- One NPC faction per continent; owns that continent's central port.
|
||||
CREATE TABLE IF NOT EXISTS factions (
|
||||
id integer unsigned primary key auto_increment,
|
||||
name varchar(255) not null,
|
||||
continent ENUM('void','Africa','Antarctica','Asia','Europe','North America','Oceania','South America') NOT NULL UNIQUE,
|
||||
leader_name varchar(255) not null,
|
||||
background TEXT,
|
||||
user_id integer not null,
|
||||
central_airport_id integer unsigned not null,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
foreign key (user_id) references users(id),
|
||||
foreign key (central_airport_id) references airports(id)
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue