diff --git a/CLAUDE.md b/CLAUDE.md index 5ebdd5d9..bfdb87e9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -86,6 +86,25 @@ the blessed subclass. It defines shared columns/timers plus overridable `use con via Moose `before`/`around` — a template-method pattern. `controller_class` points each building at its matching RPC class. +#### Schema migrations + +Schema changes are managed with `DBIx::Class::DeploymentHandler` (`Lacuna::DB::Migrate`), independent of the game's +own `$Lacuna::VERSION` — `$Lacuna::DB::VERSION` is the schema version, bumped only when a migration is needed. Deploy +and upgrade SQL lives under `var/ddl/`. + +To make a schema change: edit the `Result` class(es), bump `$Lacuna::DB::VERSION` in `lib/Lacuna/DB.pm`, then +generate the upgrade SQL (e.g. `DBIx::Class::DeploymentHandler->new({schema => Lacuna->db, script_directory => +'var/ddl', databases => 'MySQL'})->prepare_upgrade({from_version => $old, to_version => $new})`) and commit the +generated files under `var/ddl/_common/upgrade/-/` alongside the code change. + +- `bin/migrate_db.pl` installs (fresh DB) or applies pending upgrades (existing DB); idempotent, safe on every boot. + Run automatically by `bin/start_lacuna.sh` before the app starts serving. +- `bin/check_db_migration.pl` exits non-zero if the database isn't at the version the code expects, without touching + it. Run automatically by `bin/startdev.sh`, so a dev server refuses to boot against a stale schema — run + `bin/migrate_db.pl` by hand to fix. +- `bin/setup/init_lacuna.pl` (fresh dev bootstrap / full star-map reset) uses `Lacuna::DB::Migrate::reinstall`, which + drops and redeploys the whole schema from the current `Result` classes rather than applying migrations. + To add a new building, follow the checklist in `info/add_a_building.txt` (DB::Result class, entry in `Lacuna::DB::Result::Building` class types, RPC class, entry in `bin/lacuna.psgi`, `Lacuna::DB::Result::Medals`, images, and — if buildable — `Lacuna::Constants::BUILDABLE_CLASSES`; plus `SPACE_STATION_MODULES` if it's a station module). diff --git a/bin/check_db_migration.pl b/bin/check_db_migration.pl new file mode 100644 index 00000000..29503fa4 --- /dev/null +++ b/bin/check_db_migration.pl @@ -0,0 +1,26 @@ +#!/usr/bin/env perl + +# Dev-only startup gate: refuses to start the app server if the database +# schema doesn't match what the code expects, instead of silently running +# against a stale database (or auto-migrating one that might be shared). +# See bin/startdev.sh and Lacuna::DB::Migrate. Exits non-zero if a migration +# is pending. + +use 5.010; +use strict; +use lib '/home/lacuna/server/lib'; +use Lacuna::DB::Migrate; + +if (Lacuna::DB::Migrate::pending()) { + my $schema_version = Lacuna::DB::Migrate::schema_version(); + my $db_version = Lacuna::DB::Migrate::database_version(); + + say STDERR '=' x 70; + say STDERR 'Database schema is out of date -- refusing to start.'; + say STDERR " code expects version: $schema_version"; + say STDERR ' database is at version: ' . (defined $db_version ? $db_version : '(not installed)'); + say STDERR ''; + say STDERR 'Run bin/migrate_db.pl to bring the database up to date.'; + say STDERR '=' x 70; + exit 1; +} diff --git a/bin/migrate_db.pl b/bin/migrate_db.pl new file mode 100644 index 00000000..4397cdb1 --- /dev/null +++ b/bin/migrate_db.pl @@ -0,0 +1,23 @@ +#!/usr/bin/env perl + +# Applies any pending database schema migrations. Safe to run on every prod +# boot: installs from scratch against a brand new database, applies whatever +# upgrade steps are outstanding against an existing one, and does nothing if +# the database is already current. See bin/start_lacuna.sh and +# Lacuna::DB::Migrate. + +use 5.010; +use strict; +use lib '/home/lacuna/server/lib'; +use Lacuna::DB::Migrate; + +my $before = Lacuna::DB::Migrate::database_version(); +my $after = Lacuna::DB::Migrate::upgrade(); + +if (defined $before && $before eq $after) { + say "Database schema already at version $after."; +} +else { + say "Database schema migrated to version $after" + . (defined $before ? " (from $before)" : " (fresh install)") . "."; +} diff --git a/bin/prepare_db_migration.pl b/bin/prepare_db_migration.pl new file mode 100644 index 00000000..3764b111 --- /dev/null +++ b/bin/prepare_db_migration.pl @@ -0,0 +1,44 @@ +#!/usr/bin/env perl + +# Generates the deploy/upgrade SQL that bin/migrate_db.pl and +# bin/setup/init_lacuna.pl apply, from the current Result classes, under +# var/ddl/. Run this after bumping $Lacuna::DB::VERSION in lib/Lacuna/DB.pm, +# then commit whatever lands under var/ddl/ alongside the Result class change. +# +# force_overwrite is on: safe to re-run while iterating on a not-yet-committed +# schema change, but don't re-run it for a version that's already committed +# and possibly deployed -- bump the version and prepare a new upgrade step +# instead. +# +# Usage: +# perl bin/prepare_db_migration.pl # (re)generate the current version's install DDL +# perl bin/prepare_db_migration.pl # also generate an upgrade diff between two versions + +use 5.010; +use strict; +use lib '/home/lacuna/server/lib'; +use DBIx::Class::DeploymentHandler; +use Lacuna; + +my ($from_version, $to_version) = @ARGV; +die "Usage: $0 [ ]\n" + if (defined $from_version) != (defined $to_version); + +my $dh = DBIx::Class::DeploymentHandler->new({ + schema => Lacuna->db, + script_directory => '/home/lacuna/server/var/ddl', + databases => 'MySQL', + force_overwrite => 1, + # Deploy/install DDL drops each table first, so bin/setup/init_lacuna.pl + # can redeploy from scratch against a dev database that still has tables + # left over from a previous run. + sql_translator_args => { add_drop_table => 1 }, +}); + +$dh->prepare_install; +say 'Wrote install DDL for version ' . $dh->schema_version . ' to var/ddl/.'; + +if (defined $from_version) { + $dh->prepare_upgrade({ from_version => $from_version, to_version => $to_version }); + say "Wrote upgrade DDL for $from_version -> $to_version to var/ddl/."; +} diff --git a/bin/setup/init_lacuna.pl b/bin/setup/init_lacuna.pl index 7ef7638d..07526ce5 100644 --- a/bin/setup/init_lacuna.pl +++ b/bin/setup/init_lacuna.pl @@ -3,6 +3,7 @@ use strict; use 5.010; use List::Util::WeightedChoice qw( choose_weighted ); use Lacuna; +use Lacuna::DB::Migrate; use Lacuna::Util qw(randint); use DateTime; use Time::HiRes; @@ -25,7 +26,7 @@ close $star_names; say "Time Elapsed: ".Time::HiRes::tv_interval($t); sub create_database { - $db->deploy({ add_drop_table => 1 }); + Lacuna::DB::Migrate::reinstall(); } diff --git a/bin/start_lacuna.sh b/bin/start_lacuna.sh index bcf6d588..19636030 100755 --- a/bin/start_lacuna.sh +++ b/bin/start_lacuna.sh @@ -9,4 +9,8 @@ set -e cd /home/lacuna/server/bin + +# Bring the database up to date before serving traffic -- see migrate_db.pl. +perl migrate_db.pl + exec start_server --port 5000 -- starman --workers 7 --preload-app lacuna.psgi diff --git a/bin/startdev.sh b/bin/startdev.sh index b0dfcbe1..038a53a9 100755 --- a/bin/startdev.sh +++ b/bin/startdev.sh @@ -1,6 +1,13 @@ LOG_DIR="${LACUNA_LOG_DIR:-/home/lacuna/server/log}/server" mkdir -p "$LOG_DIR" || { echo "startdev.sh: cannot create $LOG_DIR" >&2; exit 1; } +cd /home/lacuna/server/bin + +# Refuse to start against a database the code doesn't match, rather than +# either running stale or silently migrating out from under a dev session -- +# see check_db_migration.pl. Run migrate_db.pl to bring it up to date. +perl check_db_migration.pl || exit 1 + # The app's own logging goes to log/server/lacuna.log via Log4perl (see # etc-*/log4perl.conf). This tee only captures plackup's framework noise -- # warnings, "Server Started", stack traces -- which never passes through diff --git a/info/setup.md b/info/setup.md index a8329161..54012838 100644 --- a/info/setup.md +++ b/info/setup.md @@ -97,24 +97,13 @@ deployed server, and not from the host. docker compose up -d ``` -2. One-off, only on a pre-existing database: apply any schema upgrades that newer code expects but an old ./data volume - never received. In particular the 'captcha.created' column (see var/upgrades/4.0001.sql): - -```bash -docker compose exec mysql \ - mysql -uroot -placuna lacuna \ - -e "alter table captcha add column \`created\` datetime NOT NULL default 0" -``` - -A database freshly built by bin/setup/init_lacuna.pl already has it. - -3. Wait for the server to answer: +2. Wait for the server to answer: ```bash curl -s http://localhost:3050/starman_ping # -> pong ``` -4. Run the tests with the helper script (the container's working directory is .../bin, so pass -w to run from the server +3. Run the tests with the helper script (the container's working directory is .../bin, so pass -w to run from the server root): ```bash @@ -128,6 +117,9 @@ npm run dev:run -- server ./run_tests.sh t/010_Empire.t # a single file t/long_running/ is excluded from the default run; pass it explicitly if you want it. - The suite needs MySQL, memcached and beanstalkd up - they are all part of the compose stack, so `docker compose up -d` covers it. +- An old `./data` volume with a database schema older than the code is fixed automatically: `bin/start_lacuna.sh` (what + the `server` container runs) applies any pending migrations on every boot before serving traffic. See + "Schema migrations" in `CLAUDE.md`. ## On the "Bare Metal" diff --git a/lib/Lacuna/DB.pm b/lib/Lacuna/DB.pm index b88f2cd2..aeecdb09 100644 --- a/lib/Lacuna/DB.pm +++ b/lib/Lacuna/DB.pm @@ -5,6 +5,12 @@ use utf8; no warnings qw(uninitialized); extends qw/DBIx::Class::Schema/; +# Schema version for DBIx::Class::DeploymentHandler (see Lacuna::DB::Migrate). +# Deliberately independent of $Lacuna::VERSION -- that tracks game releases, +# this tracks schema shape, and the two change on unrelated schedules. Bump +# this whenever a Result class change needs a migration. +our $VERSION = 1; + __PACKAGE__->load_namespaces(); sub sqlt_deploy_hook { diff --git a/lib/Lacuna/DB/Migrate.pm b/lib/Lacuna/DB/Migrate.pm new file mode 100644 index 00000000..30deba0e --- /dev/null +++ b/lib/Lacuna/DB/Migrate.pm @@ -0,0 +1,100 @@ +package Lacuna::DB::Migrate; + +# Thin wrapper around DBIx::Class::DeploymentHandler for Lacuna::DB. Deploy +# and upgrade SQL lives under var/ddl/ (one subdirectory per version, laid +# out the way DeploymentHandler expects -- see its docs for the exact +# directory shapes it reads from and writes to). +# +# Used by: +# bin/migrate_db.pl -- prod boot: install/upgrade, safe every time +# bin/check_db_migration.pl -- dev boot: refuse to start if out of date +# bin/setup/init_lacuna.pl -- dev bootstrap: wipe and redeploy from scratch + +use strict; +use warnings; +use 5.010; +use DBIx::Class::DeploymentHandler; +use Lacuna; + +use constant SCRIPT_DIRECTORY => '/home/lacuna/server/var/ddl'; +use constant VERSION_TABLE => 'dbix_class_deploymenthandler_versions'; + +# Serializes upgrade() across processes/containers, so two `server` boots +# racing each other (e.g. a restart) can't run DDL concurrently. +use constant LOCK_NAME => 'lacuna_schema_migration'; + +sub _dh { + my (%args) = @_; + return DBIx::Class::DeploymentHandler->new({ + schema => Lacuna->db, + script_directory => SCRIPT_DIRECTORY, + databases => 'MySQL', + force_overwrite => 0, + %args, + }); +} + +# The version the currently-running code expects (Lacuna::DB's $VERSION). +sub schema_version { + return _dh()->schema_version; +} + +# The version recorded in the database, or undef if the database has never +# been deployed through DeploymentHandler at all. +sub database_version { + my $dh = _dh(); + return $dh->version_storage_is_installed ? $dh->database_version : undef; +} + +# True if the database isn't at the version the code expects. +sub pending { + my $db_version = database_version(); + return 1 if !defined $db_version; + return $db_version ne schema_version(); +} + +# Safe to call on every boot: installs from scratch on a brand new database, +# applies whatever upgrade steps are outstanding on an existing one, and does +# nothing if the database is already current. Returns the resulting version. +sub upgrade { + my $dbh = Lacuna->db->storage->dbh; + + my ($got_lock) = $dbh->selectrow_array('SELECT GET_LOCK(?, 60)', undef, LOCK_NAME); + die "Lacuna::DB::Migrate: could not acquire the schema migration lock within 60s\n" + unless $got_lock; + + my $result = eval { + my $dh = _dh(); + if ($dh->version_storage_is_installed) { + $dh->upgrade; + } + else { + $dh->install; + } + $dh->database_version; + }; + my $error = $@; + + $dbh->do('SELECT RELEASE_LOCK(?)', undef, LOCK_NAME); + + die $error if $error; + return $result; +} + +# Dev-only, destructive: drops the version-tracking table (if present) and +# redeploys the whole schema from scratch, dropping/recreating every table. +# Used by bin/setup/init_lacuna.pl, which already wipes the star map on every +# run -- this just keeps the version table in step with that reset. Relies on +# the deploy DDL itself dropping each table first (see +# bin/prepare_db_migration.pl), since install() runs the already-generated, +# committed SQL as-is rather than regenerating it with different options. +sub reinstall { + my $dbh = Lacuna->db->storage->dbh; + $dbh->do('DROP TABLE IF EXISTS ' . VERSION_TABLE); + + my $dh = _dh(); + $dh->install; + return $dh->database_version; +} + +1; diff --git a/lib/Lacuna/DB/Result/AIScratchPad.pm b/lib/Lacuna/DB/Result/AIScratchPad.pm index 50852cd0..30989259 100644 --- a/lib/Lacuna/DB/Result/AIScratchPad.pm +++ b/lib/Lacuna/DB/Result/AIScratchPad.pm @@ -19,7 +19,7 @@ __PACKAGE__->set_primary_key('id'); # body_id == 0 is the "whole empire" scratch pad sentinel (see Lacuna::AI::scratch # and bin//add_colonies.pl), so this relation is only meaningful for the # per-colony pads. No FK constraint, or deploy() would create one that the -# sentinel row can never satisfy (see var/upgrades/4.0002.sql). +# sentinel row can never satisfy. __PACKAGE__->belongs_to('body', 'Lacuna::DB::Result::Map::Body', 'body_id', { is_foreign_key_constraint => 0, join_type => 'left' }); __PACKAGE__->belongs_to('empire', 'Lacuna::DB::Result::Empire', 'ai_empire_id'); diff --git a/var/ddl/MySQL/deploy/1/001-auto-__VERSION.sql b/var/ddl/MySQL/deploy/1/001-auto-__VERSION.sql new file mode 100644 index 00000000..1117f1fb --- /dev/null +++ b/var/ddl/MySQL/deploy/1/001-auto-__VERSION.sql @@ -0,0 +1,19 @@ +-- +-- Created by SQL::Translator::Producer::MySQL +-- Created on Fri Sep 18 02:14:56 2026 +-- +; +SET foreign_key_checks=0; +DROP TABLE IF EXISTS `dbix_class_deploymenthandler_versions`; +-- +-- Table: `dbix_class_deploymenthandler_versions` +-- +CREATE TABLE `dbix_class_deploymenthandler_versions` ( + `id` integer NOT NULL auto_increment, + `version` varchar(50) NOT NULL, + `ddl` text NULL, + `upgrade_sql` text NULL, + PRIMARY KEY (`id`), + UNIQUE `dbix_class_deploymenthandler_versions_version` (`version`) +); +SET foreign_key_checks=1; diff --git a/var/ddl/MySQL/deploy/1/001-auto.sql b/var/ddl/MySQL/deploy/1/001-auto.sql new file mode 100644 index 00000000..40d0b351 --- /dev/null +++ b/var/ddl/MySQL/deploy/1/001-auto.sql @@ -0,0 +1,1402 @@ +-- +-- Created by SQL::Translator::Producer::MySQL +-- Created on Fri Sep 18 02:14:56 2026 +-- +; +SET foreign_key_checks=0; +DROP TABLE IF EXISTS `alliance_log`; +-- +-- Table: `alliance_log` +-- +CREATE TABLE `alliance_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `alliance_id` integer NOT NULL, + `alliance_name` varchar(30) NOT NULL, + `member_count` integer NOT NULL, + `space_station_count` integer NOT NULL, + `space_station_count_rank` integer NOT NULL, + `influence` integer NOT NULL, + `influence_rank` integer NOT NULL, + `colony_count` integer NOT NULL, + `population` bigint NOT NULL, + `population_rank` integer NOT NULL, + `average_empire_size` bigint NOT NULL, + `average_empire_size_rank` integer NOT NULL, + `average_university_level` float(5, 2) NOT NULL, + `building_count` integer NOT NULL, + `average_building_level` float(5, 2) NOT NULL, + `spy_count` integer(11) NOT NULL, + `offense_success_rate` float(6, 6) NOT NULL, + `offense_success_rate_rank` integer(11) NOT NULL, + `defense_success_rate` float(6, 6) NOT NULL, + `defense_success_rate_rank` integer(11) NOT NULL, + `dirtiest` integer(11) NOT NULL DEFAULT 0, + `dirtiest_rank` integer(11) NOT NULL DEFAULT 0, + INDEX `idx_average_empire_size_rank` (`average_empire_size_rank`), + INDEX `idx_offense_success_rate_rank` (`offense_success_rate_rank`), + INDEX `idx_defense_success_rate_rank` (`defense_success_rate_rank`), + INDEX `idx_dirtiest_rank` (`dirtiest_rank`), + INDEX `idx_population_rank` (`population_rank`), + INDEX `idx_influence_rank` (`influence_rank`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `api_key`; +-- +-- Table: `api_key` +-- +CREATE TABLE `api_key` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `public_key` varchar(36) NOT NULL, + `private_key` varchar(36) NOT NULL, + `name` varchar(30) NULL, + `ip_address` varchar(15) NULL, + `email` varchar(255) NULL, + INDEX `idx_private_key` (`private_key`), + INDEX `idx_public_key` (`public_key`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `battle_log`; +-- +-- Table: `battle_log` +-- +CREATE TABLE `battle_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `attacking_empire_id` integer(11) NOT NULL, + `attacking_empire_name` varchar(30) NOT NULL, + `attacking_body_id` integer(11) NOT NULL, + `attacking_body_name` varchar(30) NOT NULL, + `attacking_unit_name` varchar(60) NOT NULL, + `attacking_type` varchar(60) NOT NULL, + `attacking_number` integer(11) NOT NULL, + `defending_empire_id` integer(11) NULL, + `defending_empire_name` varchar(30) NULL, + `defending_body_id` integer(11) NOT NULL, + `defending_body_name` varchar(30) NOT NULL, + `defending_unit_name` varchar(60) NOT NULL, + `defending_type` varchar(60) NOT NULL, + `defending_number` integer(11) NOT NULL, + `victory_to` varchar(8) NOT NULL, + `attacked_body_id` integer(11) NOT NULL, + `attacked_body_name` varchar(30) NOT NULL, + `attacked_empire_id` integer(11) NULL, + `attacked_empire_name` varchar(30) NULL, + INDEX `idx_datestamp` (`date_stamp`), + INDEX `idx_attacking_empire_id` (`attacking_empire_id`), + INDEX `idx_attacking_empire_name` (`attacking_empire_name`), + INDEX `idx_attacking_body_id` (`attacking_body_id`), + INDEX `idx_attacking_body_name` (`attacking_body_name`), + INDEX `idx_defending_empire_id` (`defending_empire_id`), + INDEX `idx_defending_empire_name` (`defending_empire_name`), + INDEX `idx_defending_body_id` (`defending_body_id`), + INDEX `idx_defending_body_name` (`defending_body_name`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `captcha`; +-- +-- Table: `captcha` +-- +CREATE TABLE `captcha` ( + `id` integer(11) NOT NULL auto_increment, + `riddle` varchar(12) NOT NULL, + `solution` varchar(5) NOT NULL, + `guid` varchar(36) NOT NULL, + `created` datetime NOT NULL, + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `cargo_log`; +-- +-- Table: `cargo_log` +-- +CREATE TABLE `cargo_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `object_type` varchar(255) NOT NULL, + `object_id` integer NOT NULL, + `body_id` integer NOT NULL, + `message` varchar(255) NOT NULL, + `data` mediumblob NULL, + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `colony_log`; +-- +-- Table: `colony_log` +-- +CREATE TABLE `colony_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + `planet_id` integer(11) NOT NULL, + `planet_name` varchar(30) NOT NULL, + `population` integer(11) NOT NULL, + `population_rank` integer(11) NOT NULL, + `population_delta` integer(11) NOT NULL, + `building_count` tinyint NOT NULL, + `average_building_level` float(5, 2) NOT NULL, + `highest_building_level` tinyint NOT NULL, + `food_hour` integer(11) NOT NULL, + `energy_hour` integer(11) NOT NULL, + `waste_hour` integer(11) NOT NULL, + `ore_hour` integer(11) NOT NULL, + `water_hour` integer(11) NOT NULL, + `happiness_hour` integer(11) NOT NULL, + `spy_count` integer(11) NOT NULL, + `average_spy_success_rate` float(6, 6) NOT NULL DEFAULT 0, + `offense_success_rate` float(6, 6) NOT NULL DEFAULT 0, + `offense_success_rate_delta` float(6, 6) NOT NULL DEFAULT 0, + `defense_success_rate` float(6, 6) NOT NULL DEFAULT 0, + `defense_success_rate_delta` float(6, 6) NOT NULL DEFAULT 0, + `dirtiest` integer(11) NOT NULL DEFAULT 0, + `dirtiest_delta` integer(11) NOT NULL DEFAULT 0, + `is_space_station` integer(11) NOT NULL DEFAULT 0, + `influence` integer(11) NOT NULL DEFAULT 0, + `x` integer(11) NOT NULL DEFAULT 0, + `y` integer(11) NOT NULL DEFAULT 0, + `body_id` integer(11) NOT NULL DEFAULT 0, + `zone` varchar(16) NOT NULL DEFAULT '0', + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + INDEX `idx_population_rank` (`population_rank`), + INDEX `idx_planet_id` (`planet_id`), + INDEX `idx_planet_name` (`planet_name`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `config`; +-- +-- Table: `config` +-- +CREATE TABLE `config` ( + `id` integer(11) NOT NULL auto_increment, + `name` varchar(30) NOT NULL, + `value` text NOT NULL, + INDEX `c_idx_key` (`name`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `economy_log`; +-- +-- Table: `economy_log` +-- +CREATE TABLE `economy_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` date NOT NULL, + `total_users` integer NOT NULL DEFAULT 0, + `purchases_30` integer NOT NULL DEFAULT 0, + `purchases_100` integer NOT NULL DEFAULT 0, + `purchases_200` integer NOT NULL DEFAULT 0, + `purchases_600` integer NOT NULL DEFAULT 0, + `purchases_1300` integer NOT NULL DEFAULT 0, + `in_purchase` integer NOT NULL DEFAULT 0, + `in_trade` integer NOT NULL DEFAULT 0, + `in_redemption` integer NOT NULL DEFAULT 0, + `in_vein` integer NOT NULL DEFAULT 0, + `in_vote` integer NOT NULL DEFAULT 0, + `in_tutorial` integer NOT NULL DEFAULT 0, + `in_mission` integer NOT NULL DEFAULT 0, + `in_other` integer NOT NULL DEFAULT 0, + `out_boost` integer NOT NULL DEFAULT 0, + `out_mission` integer NOT NULL DEFAULT 0, + `out_recycle` integer NOT NULL DEFAULT 0, + `out_ship` integer NOT NULL DEFAULT 0, + `out_spy` integer NOT NULL DEFAULT 0, + `out_glyph` integer NOT NULL DEFAULT 0, + `out_party` integer NOT NULL DEFAULT 0, + `out_building` integer NOT NULL DEFAULT 0, + `out_trade` integer NOT NULL DEFAULT 0, + `out_delete` integer NOT NULL DEFAULT 0, + `out_other` integer NOT NULL DEFAULT 0, + INDEX `idx_date_stamp` (`date_stamp`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `empire_admin_notes`; +-- +-- Table: `empire_admin_notes` +-- +CREATE TABLE `empire_admin_notes` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + `notes` text NOT NULL, + `creator` varchar(30) NOT NULL, + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `empire_log`; +-- +-- Table: `empire_log` +-- +CREATE TABLE `empire_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + `colony_count` tinyint NOT NULL, + `colony_count_delta` tinyint NOT NULL, + `population` integer(11) NOT NULL, + `population_delta` integer(11) NOT NULL, + `empire_size` bigint(11) NOT NULL, + `empire_size_delta` integer(11) NOT NULL, + `empire_size_rank` integer(11) NOT NULL, + `building_count` smallint NOT NULL, + `university_level` tinyint NOT NULL, + `university_level_rank` tinyint NOT NULL, + `average_building_level` float(5, 2) NOT NULL, + `highest_building_level` tinyint(3) NOT NULL, + `food_hour` integer(11) NOT NULL, + `energy_hour` integer(11) NOT NULL, + `waste_hour` integer(11) NOT NULL, + `ore_hour` integer(11) NOT NULL, + `water_hour` integer(11) NOT NULL, + `happiness_hour` integer(11) NOT NULL, + `spy_count` integer(11) NOT NULL, + `offense_success_rate` float(6, 6) NOT NULL, + `offense_success_rate_rank` integer(11) NOT NULL, + `offense_success_rate_delta` float(6, 6) NOT NULL DEFAULT 0, + `defense_success_rate` float(6, 6) NOT NULL, + `defense_success_rate_rank` integer(11) NOT NULL, + `defense_success_rate_delta` float(6, 6) NOT NULL DEFAULT 0, + `dirtiest` integer(11) NOT NULL DEFAULT 0, + `dirtiest_rank` integer(11) NOT NULL DEFAULT 0, + `dirtiest_delta` integer(11) NOT NULL DEFAULT 0, + `alliance_id` integer NULL, + `alliance_name` varchar(30) NULL, + `space_station_count` integer(11) NOT NULL DEFAULT 0, + `influence` integer(11) NOT NULL DEFAULT 0, + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + INDEX `idx_empire_size_rank` (`empire_size_rank`), + INDEX `idx_university_level_rank` (`university_level_rank`), + INDEX `idx_offense_success_rate_rank` (`offense_success_rate_rank`), + INDEX `idx_defense_success_rate_rank` (`defense_success_rate_rank`), + INDEX `idx_dirtiest_rank` (`dirtiest_rank`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `empire_name_change_log`; +-- +-- Table: `empire_name_change_log` +-- +CREATE TABLE `empire_name_change_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + `old_empire_name` varchar(30) NOT NULL, + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `empire_rpc_log`; +-- +-- Table: `empire_rpc_log` +-- +CREATE TABLE `empire_rpc_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + `rpc` integer(11) NOT NULL DEFAULT 0, + `limits` integer(11) NOT NULL DEFAULT 0, + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `essentia_code`; +-- +-- Table: `essentia_code` +-- +CREATE TABLE `essentia_code` ( + `id` integer(11) NOT NULL auto_increment, + `code` varchar(36) NOT NULL, + `amount` float(11, 1) NOT NULL, + `date_created` datetime NOT NULL, + `description` varchar(50) NOT NULL, + `used` tinyint NOT NULL DEFAULT 0, + `empire_id` integer(11) NOT NULL, + INDEX `idx_code` (`code`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `essentia_log`; +-- +-- Table: `essentia_log` +-- +CREATE TABLE `essentia_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + `api_key` varchar(40) NULL, + `amount` float(11, 1) NOT NULL, + `description` varchar(90) NOT NULL, + `transaction_id` varchar(36) NULL, + `from_id` integer(11) NOT NULL, + `from_name` varchar(30) NOT NULL, + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + INDEX `idx_api_key` (`api_key`), + INDEX `idx_transaction_id` (`transaction_id`), + INDEX `idx_essentiacode` (`empire_id`, `description`, `amount`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `login_log`; +-- +-- Table: `login_log` +-- +CREATE TABLE `login_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + `api_key` varchar(36) NULL, + `session_id` char(36) NOT NULL, + `ip_address` varchar(15) NULL, + `log_out_date` datetime NULL, + `extended` integer(11) NOT NULL DEFAULT 0, + `is_sitter` integer(1) NOT NULL DEFAULT 0, + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + INDEX `idx_api_key` (`api_key`), + INDEX `idx_session_id` (`session_id`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `lottery_log`; +-- +-- Table: `lottery_log` +-- +CREATE TABLE `lottery_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + `api_key` varchar(40) NULL, + `url` varchar(255) NOT NULL, + `ip_address` varchar(15) NULL, + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + INDEX `idx_api_key` (`api_key`), + INDEX `idx_url` (`url`), + INDEX `idx_ip_address` (`ip_address`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `mission`; +-- +-- Table: `mission` +-- +CREATE TABLE `mission` ( + `id` integer(11) NOT NULL auto_increment, + `mission_file_name` varchar(100) NOT NULL, + `zone` varchar(16) NOT NULL, + `date_posted` datetime NOT NULL, + `max_university_level` tinyint NOT NULL, + `scratch` mediumblob NULL, + INDEX `idx_zone_date_posted` (`zone`, `date_posted`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `mission_log`; +-- +-- Table: `mission_log` +-- +CREATE TABLE `mission_log` ( + `id` integer(11) NOT NULL auto_increment, + `filename` varchar(255) NOT NULL, + `offers` integer NOT NULL DEFAULT 0, + `skips` integer NOT NULL DEFAULT 0, + `skip_uni_level` bigint NOT NULL DEFAULT 0, + `completes` integer NOT NULL DEFAULT 0, + `complete_uni_level` bigint NOT NULL DEFAULT 0, + `seconds_to_complete` bigint NOT NULL DEFAULT 0, + `incompletes` integer NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `news`; +-- +-- Table: `news` +-- +CREATE TABLE `news` ( + `id` integer(11) NOT NULL auto_increment, + `headline` varchar(140) NOT NULL, + `zone` varchar(16) NOT NULL, + `date_posted` datetime NOT NULL, + INDEX `idx_zone_date_posted` (`zone`, `date_posted`), + INDEX `idx_date_posted` (`date_posted`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `noexist_with_empire_log`; +-- +-- Table: `noexist_with_empire_log` +-- +CREATE TABLE `noexist_with_empire_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `promotion`; +-- +-- Table: `promotion` +-- +CREATE TABLE `promotion` ( + `id` integer(11) NOT NULL auto_increment, + `start_date` datetime NOT NULL, + `end_date` datetime NOT NULL, + `type` varchar(30) NOT NULL, + `min_purchase` integer NULL, + `max_purchase` integer NULL, + `payload` mediumblob NULL, + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `rpc_log`; +-- +-- Table: `rpc_log` +-- +CREATE TABLE `rpc_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + `api_key` varchar(40) NULL, + `module` varchar(255) NOT NULL, + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + INDEX `idx_api_key` (`api_key`), + INDEX `idx_module` (`module`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `schedule`; +-- +-- Table: `schedule` +-- +CREATE TABLE `schedule` ( + `id` integer(11) NOT NULL auto_increment, + `queue` varchar(30) NOT NULL, + `job_id` integer(11) NOT NULL, + `delivery` datetime NOT NULL, + `priority` integer(11) NOT NULL DEFAULT 1000, + `parent_table` varchar(30) NOT NULL, + `parent_id` integer(11) NOT NULL, + `task` varchar(30) NOT NULL, + `args` mediumblob NULL, + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `spy_log`; +-- +-- Table: `spy_log` +-- +CREATE TABLE `spy_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + `spy_name` varchar(30) NOT NULL, + `spy_id` integer(11) NOT NULL, + `planet_name` varchar(30) NOT NULL, + `planet_id` integer(11) NOT NULL, + `level` integer(11) NOT NULL, + `level_rank` integer(11) NOT NULL, + `level_delta` integer(11) NOT NULL DEFAULT 0, + `offense_success_rate` float(6, 6) NOT NULL, + `offense_success_rate_delta` float(6, 6) NOT NULL DEFAULT 0, + `defense_success_rate` float(6, 6) NOT NULL, + `defense_success_rate_delta` float(6, 6) NOT NULL DEFAULT 0, + `success_rate` float(6, 6) NOT NULL, + `success_rate_rank` integer(11) NOT NULL, + `success_rate_delta` float(6, 6) NOT NULL DEFAULT 0, + `age` integer(11) NOT NULL, + `times_captured` integer(11) NOT NULL DEFAULT 0, + `times_turned` integer(11) NOT NULL DEFAULT 0, + `seeds_planted` integer(11) NOT NULL DEFAULT 0, + `spies_killed` integer(11) NOT NULL DEFAULT 0, + `spies_captured` integer(11) NOT NULL DEFAULT 0, + `spies_turned` integer(11) NOT NULL DEFAULT 0, + `things_destroyed` integer(11) NOT NULL DEFAULT 0, + `things_stolen` integer(11) NOT NULL DEFAULT 0, + `dirtiest` integer(11) NOT NULL DEFAULT 0, + `dirtiest_rank` integer(11) NOT NULL, + `dirtiest_delta` integer(11) NOT NULL DEFAULT 0, + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + INDEX `idx_level_rank` (`level_rank`), + INDEX `idx_success_rate_rank` (`success_rate_rank`), + INDEX `idx_dirtiest_rank` (`dirtiest_rank`), + INDEX `idx_planet_id` (`planet_id`), + INDEX `idx_planet_name` (`planet_name`), + INDEX `idx_spy_id` (`spy_id`), + INDEX `idx_spy_name` (`spy_name`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `viral_log`; +-- +-- Table: `viral_log` +-- +CREATE TABLE `viral_log` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` date NOT NULL, + `total_users` integer NOT NULL DEFAULT 0, + `creates` integer NOT NULL DEFAULT 0, + `invites` integer NOT NULL DEFAULT 0, + `accepts` integer NOT NULL DEFAULT 0, + `deletes` integer NOT NULL DEFAULT 0, + `abandons` integer NOT NULL DEFAULT 0, + `active_duration` integer NOT NULL DEFAULT 0, + INDEX `idx_date_stamp` (`date_stamp`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `weekly_medal_winner`; +-- +-- Table: `weekly_medal_winner` +-- +CREATE TABLE `weekly_medal_winner` ( + `id` integer(11) NOT NULL auto_increment, + `date_stamp` datetime NOT NULL, + `empire_id` integer(11) NOT NULL, + `empire_name` varchar(30) NOT NULL, + `medal_id` integer NOT NULL, + `medal_name` varchar(50) NOT NULL, + `times_earned` integer NOT NULL, + `medal_image` varchar(50) NOT NULL, + INDEX `idx_empire_id` (`empire_id`), + INDEX `idx_empire_name` (`empire_name`), + PRIMARY KEY (`id`) +); +DROP TABLE IF EXISTS `alliance`; +-- +-- Table: `alliance` +-- +CREATE TABLE `alliance` ( + `id` integer(11) NOT NULL auto_increment, + `name` varchar(30) NOT NULL, + `leader_id` integer(11) NULL, + `forum_uri` varchar(255) NOT NULL, + `description` text NULL, + `announcements` text NULL, + `date_created` datetime NOT NULL, + `stash` mediumblob NULL, + `image` varchar(255) NOT NULL DEFAULT 'default', + INDEX `alliance_idx_leader_id` (`leader_id`), + PRIMARY KEY (`id`), + CONSTRAINT `alliance_fk_leader_id` FOREIGN KEY (`leader_id`) REFERENCES `empire` (`id`) ON DELETE SET NULL +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `message`; +-- +-- Table: `message` +-- +CREATE TABLE `message` ( + `id` integer(11) NOT NULL auto_increment, + `in_reply_to` integer(11) NULL, + `subject` varchar(64) NOT NULL, + `body` mediumtext NULL, + `date_sent` datetime NOT NULL, + `from_id` integer(11) NOT NULL, + `from_name` varchar(30) NOT NULL, + `to_id` integer(11) NULL, + `to_name` varchar(30) NOT NULL, + `recipients` mediumblob NULL, + `tag` varchar(15) NULL, + `has_read` tinyint NOT NULL DEFAULT 0, + `has_replied` tinyint NOT NULL DEFAULT 0, + `has_archived` tinyint NOT NULL DEFAULT 0, + `has_trashed` tinyint NOT NULL DEFAULT 0, + `attachments` mediumblob NULL, + `repeat_check` varchar(30) NULL, + INDEX `message_idx_to_id` (`to_id`), + INDEX `message_idx_from_id` (`from_id`), + INDEX `idx_repeat_check_date_sent` (`repeat_check`, `date_sent`), + INDEX `idx_recent_messages` (`has_archived`, `has_read`, `to_id`, `date_sent`), + INDEX `idx_inbox_only` (`has_archived`, `to_id`, `date_sent`), + INDEX `idx_trash_only` (`has_trashed`, `to_id`, `date_sent`), + PRIMARY KEY (`id`), + CONSTRAINT `message_fk_to_id` FOREIGN KEY (`to_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `message_fk_from_id` FOREIGN KEY (`from_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `star`; +-- +-- Table: `star` +-- +CREATE TABLE `star` ( + `id` integer(11) NOT NULL auto_increment, + `name` varchar(30) NOT NULL, + `x` integer(11) NOT NULL DEFAULT 0, + `y` integer(11) NOT NULL DEFAULT 0, + `zone` varchar(16) NOT NULL, + `color` varchar(7) NOT NULL, + `station_id` integer NULL, + `influence` integer NULL, + `needs_recalc` tinyint NOT NULL DEFAULT 0, + INDEX `star_idx_station_id` (`station_id`), + INDEX `idx_recalc` (`needs_recalc`), + PRIMARY KEY (`id`), + CONSTRAINT `star_fk_station_id` FOREIGN KEY (`station_id`) REFERENCES `body` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `body`; +-- +-- Table: `body` +-- +CREATE TABLE `body` ( + `id` integer(11) NOT NULL auto_increment, + `name` varchar(30) NOT NULL, + `x` integer(11) NOT NULL DEFAULT 0, + `y` integer(11) NOT NULL DEFAULT 0, + `zone` varchar(16) NOT NULL, + `star_id` integer NOT NULL, + `alliance_id` integer NULL, + `orbit` integer NOT NULL DEFAULT 0, + `class` varchar(255) NOT NULL, + `size` integer NOT NULL DEFAULT 0, + `usable_as_starter` integer NOT NULL DEFAULT 0, + `usable_as_starter_enabled` tinyint NOT NULL DEFAULT 0, + `empire_id` integer NULL, + `last_tick` datetime NOT NULL, + `happiness_hour` bigint NOT NULL DEFAULT 0, + `happiness` bigint NOT NULL DEFAULT 0, + `waste_hour` bigint NOT NULL DEFAULT 0, + `waste_stored` bigint NOT NULL DEFAULT 0, + `waste_capacity` bigint NOT NULL DEFAULT 0, + `energy_hour` bigint NOT NULL DEFAULT 0, + `energy_stored` bigint NOT NULL DEFAULT 0, + `energy_capacity` bigint NOT NULL DEFAULT 0, + `water_hour` bigint NOT NULL DEFAULT 0, + `water_stored` bigint NOT NULL DEFAULT 0, + `water_capacity` bigint NOT NULL DEFAULT 0, + `ore_capacity` bigint NOT NULL DEFAULT 0, + `rutile_stored` bigint NOT NULL DEFAULT 0, + `chromite_stored` bigint NOT NULL DEFAULT 0, + `chalcopyrite_stored` bigint NOT NULL DEFAULT 0, + `galena_stored` bigint NOT NULL DEFAULT 0, + `gold_stored` bigint NOT NULL DEFAULT 0, + `uraninite_stored` bigint NOT NULL DEFAULT 0, + `bauxite_stored` bigint NOT NULL DEFAULT 0, + `goethite_stored` bigint NOT NULL DEFAULT 0, + `halite_stored` bigint NOT NULL DEFAULT 0, + `gypsum_stored` bigint NOT NULL DEFAULT 0, + `trona_stored` bigint NOT NULL DEFAULT 0, + `kerogen_stored` bigint NOT NULL DEFAULT 0, + `methane_stored` bigint NOT NULL DEFAULT 0, + `anthracite_stored` bigint NOT NULL DEFAULT 0, + `sulfur_stored` bigint NOT NULL DEFAULT 0, + `zircon_stored` bigint NOT NULL DEFAULT 0, + `monazite_stored` bigint NOT NULL DEFAULT 0, + `fluorite_stored` bigint NOT NULL DEFAULT 0, + `beryl_stored` bigint NOT NULL DEFAULT 0, + `magnetite_stored` bigint NOT NULL DEFAULT 0, + `rutile_hour` bigint NOT NULL DEFAULT 0, + `chromite_hour` bigint NOT NULL DEFAULT 0, + `chalcopyrite_hour` bigint NOT NULL DEFAULT 0, + `galena_hour` bigint NOT NULL DEFAULT 0, + `gold_hour` bigint NOT NULL DEFAULT 0, + `uraninite_hour` bigint NOT NULL DEFAULT 0, + `bauxite_hour` bigint NOT NULL DEFAULT 0, + `goethite_hour` bigint NOT NULL DEFAULT 0, + `halite_hour` bigint NOT NULL DEFAULT 0, + `gypsum_hour` bigint NOT NULL DEFAULT 0, + `trona_hour` bigint NOT NULL DEFAULT 0, + `kerogen_hour` bigint NOT NULL DEFAULT 0, + `methane_hour` bigint NOT NULL DEFAULT 0, + `anthracite_hour` bigint NOT NULL DEFAULT 0, + `sulfur_hour` bigint NOT NULL DEFAULT 0, + `zircon_hour` bigint NOT NULL DEFAULT 0, + `monazite_hour` bigint NOT NULL DEFAULT 0, + `fluorite_hour` bigint NOT NULL DEFAULT 0, + `beryl_hour` bigint NOT NULL DEFAULT 0, + `magnetite_hour` bigint NOT NULL DEFAULT 0, + `ore_consumption_hour` bigint NOT NULL DEFAULT 0, + `food_capacity` bigint NOT NULL DEFAULT 0, + `food_consumption_hour` bigint NOT NULL DEFAULT 0, + `lapis_production_hour` bigint NOT NULL DEFAULT 0, + `potato_production_hour` bigint NOT NULL DEFAULT 0, + `apple_production_hour` bigint NOT NULL DEFAULT 0, + `root_production_hour` bigint NOT NULL DEFAULT 0, + `corn_production_hour` bigint NOT NULL DEFAULT 0, + `cider_production_hour` bigint NOT NULL DEFAULT 0, + `wheat_production_hour` bigint NOT NULL DEFAULT 0, + `bread_production_hour` bigint NOT NULL DEFAULT 0, + `soup_production_hour` bigint NOT NULL DEFAULT 0, + `chip_production_hour` bigint NOT NULL DEFAULT 0, + `pie_production_hour` bigint NOT NULL DEFAULT 0, + `pancake_production_hour` bigint NOT NULL DEFAULT 0, + `milk_production_hour` bigint NOT NULL DEFAULT 0, + `meal_production_hour` bigint NOT NULL DEFAULT 0, + `algae_production_hour` bigint NOT NULL DEFAULT 0, + `syrup_production_hour` bigint NOT NULL DEFAULT 0, + `fungus_production_hour` bigint NOT NULL DEFAULT 0, + `burger_production_hour` bigint NOT NULL DEFAULT 0, + `shake_production_hour` bigint NOT NULL DEFAULT 0, + `beetle_production_hour` bigint NOT NULL DEFAULT 0, + `bean_production_hour` bigint NOT NULL DEFAULT 0, + `cheese_production_hour` bigint NOT NULL DEFAULT 0, + `cheese_stored` bigint NOT NULL DEFAULT 0, + `bean_stored` bigint NOT NULL DEFAULT 0, + `lapis_stored` bigint NOT NULL DEFAULT 0, + `potato_stored` bigint NOT NULL DEFAULT 0, + `apple_stored` bigint NOT NULL DEFAULT 0, + `root_stored` bigint NOT NULL DEFAULT 0, + `corn_stored` bigint NOT NULL DEFAULT 0, + `cider_stored` bigint NOT NULL DEFAULT 0, + `wheat_stored` bigint NOT NULL DEFAULT 0, + `bread_stored` bigint NOT NULL DEFAULT 0, + `soup_stored` bigint NOT NULL DEFAULT 0, + `chip_stored` bigint NOT NULL DEFAULT 0, + `pie_stored` bigint NOT NULL DEFAULT 0, + `pancake_stored` bigint NOT NULL DEFAULT 0, + `milk_stored` bigint NOT NULL DEFAULT 0, + `meal_stored` bigint NOT NULL DEFAULT 0, + `algae_stored` bigint NOT NULL DEFAULT 0, + `syrup_stored` bigint NOT NULL DEFAULT 0, + `fungus_stored` bigint NOT NULL DEFAULT 0, + `burger_stored` bigint NOT NULL DEFAULT 0, + `shake_stored` bigint NOT NULL DEFAULT 0, + `beetle_stored` bigint NOT NULL DEFAULT 0, + `boost_enabled` tinyint NOT NULL DEFAULT 0, + `needs_recalc` tinyint NOT NULL DEFAULT 0, + `needs_surface_refresh` tinyint NOT NULL DEFAULT 0, + `restrict_coverage` tinyint NOT NULL DEFAULT 0, + `plots_available` tinyint NOT NULL DEFAULT 0, + `surface_version` tinyint NOT NULL DEFAULT 0, + `max_berth` tinyint NOT NULL DEFAULT 1, + `unhappy_date` datetime NOT NULL, + `unhappy` tinyint NOT NULL DEFAULT 0, + `propaganda_boost` integer NOT NULL DEFAULT 0, + `neutral_entry` datetime NOT NULL, + `notes` text NULL, + INDEX `body_idx_alliance_id` (`alliance_id`), + INDEX `body_idx_empire_id` (`empire_id`), + INDEX `body_idx_star_id` (`star_id`), + INDEX `idx_x_y` (`x`, `y`), + INDEX `idx_zone` (`zone`), + INDEX `idx_name` (`name`), + INDEX `idx_class` (`class`), + INDEX `idx_usable_as_starter` (`usable_as_starter`), + INDEX `idx_usable_as_starter_enabled` (`usable_as_starter_enabled`), + INDEX `idx_planet_search` (`usable_as_starter_enabled`, `usable_as_starter`), + PRIMARY KEY (`id`), + CONSTRAINT `body_fk_alliance_id` FOREIGN KEY (`alliance_id`) REFERENCES `alliance` (`id`) ON DELETE SET NULL, + CONSTRAINT `body_fk_empire_id` FOREIGN KEY (`empire_id`) REFERENCES `empire` (`id`), + CONSTRAINT `body_fk_star_id` FOREIGN KEY (`star_id`) REFERENCES `star` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `empire`; +-- +-- Table: `empire` +-- +CREATE TABLE `empire` ( + `id` integer(11) NOT NULL auto_increment, + `name` varchar(30) NOT NULL, + `stage` varchar(30) NOT NULL DEFAULT 'new', + `date_created` datetime NOT NULL, + `self_destruct_date` datetime NOT NULL, + `self_destruct_active` tinyint NOT NULL DEFAULT 0, + `description` text NULL, + `notes` text NULL, + `home_planet_id` integer NULL, + `status_message` varchar(255) NOT NULL, + `password` char(43) NOT NULL, + `sitter_password` varchar(30) NOT NULL, + `email` varchar(255) NULL, + `city` varchar(100) NULL, + `country` varchar(100) NULL, + `skype` varchar(100) NULL, + `player_name` varchar(100) NULL, + `password_recovery_key` varchar(36) NULL, + `last_login` datetime NOT NULL, + `essentia_free` float(11, 1) NOT NULL DEFAULT 0, + `essentia_game` float(11, 1) NOT NULL DEFAULT 0, + `essentia_paid` float(11, 1) NOT NULL DEFAULT 0, + `university_level` tinyint NOT NULL DEFAULT 0, + `tutorial_stage` varchar(30) NOT NULL DEFAULT 'explore_the_ui', + `tutorial_scratch` text NULL, + `is_isolationist` tinyint NOT NULL DEFAULT 1, + `storage_boost` datetime NOT NULL, + `food_boost` datetime NOT NULL, + `water_boost` datetime NOT NULL, + `ore_boost` datetime NOT NULL, + `energy_boost` datetime NOT NULL, + `happiness_boost` datetime NOT NULL, + `building_boost` datetime NOT NULL, + `spy_training_boost` datetime NOT NULL, + `alliance_id` integer NULL, + `species_name` varchar(30) NOT NULL DEFAULT 'Human', + `species_description` text NULL, + `min_orbit` tinyint NOT NULL DEFAULT 3, + `max_orbit` tinyint NOT NULL DEFAULT 3, + `manufacturing_affinity` tinyint NOT NULL DEFAULT 4, + `deception_affinity` tinyint NOT NULL DEFAULT 4, + `research_affinity` tinyint NOT NULL DEFAULT 4, + `management_affinity` tinyint NOT NULL DEFAULT 4, + `farming_affinity` tinyint NOT NULL DEFAULT 4, + `mining_affinity` tinyint NOT NULL DEFAULT 4, + `science_affinity` tinyint NOT NULL DEFAULT 4, + `environmental_affinity` tinyint NOT NULL DEFAULT 4, + `political_affinity` tinyint NOT NULL DEFAULT 4, + `trade_affinity` tinyint NOT NULL DEFAULT 4, + `growth_affinity` tinyint NOT NULL DEFAULT 4, + `skip_medal_messages` tinyint NOT NULL DEFAULT 0, + `skip_pollution_warnings` tinyint NOT NULL DEFAULT 0, + `skip_resource_warnings` tinyint NOT NULL DEFAULT 0, + `skip_happiness_warnings` tinyint NOT NULL DEFAULT 0, + `is_admin` tinyint NOT NULL DEFAULT 0, + `is_mission_curator` tinyint NOT NULL DEFAULT 0, + `skip_found_nothing` tinyint NOT NULL DEFAULT 0, + `skip_excavator_resources` tinyint NOT NULL DEFAULT 0, + `skip_excavator_glyph` tinyint NOT NULL DEFAULT 0, + `skip_excavator_plan` tinyint NOT NULL DEFAULT 0, + `skip_spy_recovery` tinyint NOT NULL DEFAULT 0, + `skip_probe_detected` tinyint NOT NULL DEFAULT 0, + `skip_attack_messages` tinyint NOT NULL DEFAULT 0, + `skip_excavator_artifact` tinyint NOT NULL DEFAULT 0, + `skip_excavator_destroyed` tinyint NOT NULL DEFAULT 0, + `skip_excavator_replace_msg` tinyint NOT NULL DEFAULT 0, + `dont_replace_excavator` tinyint NOT NULL DEFAULT 0, + `latest_message_id` integer NULL, + `skip_incoming_ships` tinyint NOT NULL DEFAULT 0, + `in_stasis` tinyint NOT NULL DEFAULT 0, + `timeout` tinyint NOT NULL DEFAULT 0, + `outlaw` tinyint NOT NULL DEFAULT 0, + `outlaw_date` datetime NOT NULL DEFAULT '2010-10-03 18:17:26', + INDEX `empire_idx_alliance_id` (`alliance_id`), + INDEX `empire_idx_home_planet_id` (`home_planet_id`), + INDEX `empire_idx_latest_message_id` (`latest_message_id`), + INDEX `idx_self_destruct` (`self_destruct_active`, `self_destruct_date`), + INDEX `idx_password_recovery_key` (`password_recovery_key`), + INDEX `idx_inactives` (`last_login`, `self_destruct_active`), + INDEX `idx_admins` (`name`, `is_admin`), + PRIMARY KEY (`id`), + UNIQUE `name` (`name`), + CONSTRAINT `empire_fk_alliance_id` FOREIGN KEY (`alliance_id`) REFERENCES `alliance` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `empire_fk_home_planet_id` FOREIGN KEY (`home_planet_id`) REFERENCES `body` (`id`), + CONSTRAINT `empire_fk_latest_message_id` FOREIGN KEY (`latest_message_id`) REFERENCES `message` (`id`) ON DELETE SET NULL +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `ai_battle_summary`; +-- +-- Table: `ai_battle_summary` +-- +CREATE TABLE `ai_battle_summary` ( + `id` integer(11) NOT NULL auto_increment, + `attacking_empire_id` integer(11) NOT NULL, + `defending_empire_id` integer(11) NOT NULL, + `attack_victories` integer(11) NOT NULL DEFAULT 0, + `defense_victories` integer(11) NOT NULL DEFAULT 0, + `attack_spy_hours` integer(11) NOT NULL DEFAULT 0, + INDEX `ai_battle_summary_idx_attacking_empire_id` (`attacking_empire_id`), + INDEX `ai_battle_summary_idx_defending_empire_id` (`defending_empire_id`), + PRIMARY KEY (`id`), + CONSTRAINT `ai_battle_summary_fk_attacking_empire_id` FOREIGN KEY (`attacking_empire_id`) REFERENCES `empire` (`id`), + CONSTRAINT `ai_battle_summary_fk_defending_empire_id` FOREIGN KEY (`defending_empire_id`) REFERENCES `empire` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `ai_scratch_pad`; +-- +-- Table: `ai_scratch_pad` +-- +CREATE TABLE `ai_scratch_pad` ( + `id` integer(11) NOT NULL auto_increment, + `ai_empire_id` integer(11) NOT NULL, + `body_id` integer(11) NULL, + `pad` mediumblob NULL, + INDEX `ai_scratch_pad_idx_ai_empire_id` (`ai_empire_id`), + PRIMARY KEY (`id`), + CONSTRAINT `ai_scratch_pad_fk_ai_empire_id` FOREIGN KEY (`ai_empire_id`) REFERENCES `empire` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `alliance_invite`; +-- +-- Table: `alliance_invite` +-- +CREATE TABLE `alliance_invite` ( + `id` integer(11) NOT NULL auto_increment, + `alliance_id` integer NOT NULL, + `empire_id` integer NOT NULL, + `date_created` datetime NOT NULL, + INDEX `alliance_invite_idx_alliance_id` (`alliance_id`), + INDEX `alliance_invite_idx_empire_id` (`empire_id`), + PRIMARY KEY (`id`), + CONSTRAINT `alliance_invite_fk_alliance_id` FOREIGN KEY (`alliance_id`) REFERENCES `alliance` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `alliance_invite_fk_empire_id` FOREIGN KEY (`empire_id`) REFERENCES `empire` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `building`; +-- +-- Table: `building` +-- +CREATE TABLE `building` ( + `id` integer(11) NOT NULL auto_increment, + `date_created` datetime NOT NULL, + `body_id` integer(11) NOT NULL, + `x` integer(11) NOT NULL DEFAULT 0, + `y` integer(11) NOT NULL DEFAULT 0, + `level` integer(11) NOT NULL DEFAULT 0, + `class` varchar(255) NOT NULL, + `upgrade_started` datetime NOT NULL, + `upgrade_ends` datetime NOT NULL, + `is_upgrading` tinyint NOT NULL DEFAULT '0', + `work_started` datetime NOT NULL, + `work_ends` datetime NOT NULL, + `is_working` tinyint NOT NULL DEFAULT '0', + `work` mediumblob NULL, + `efficiency` integer NOT NULL DEFAULT 100, + `last_check` datetime NOT NULL, + INDEX `building_idx_body_id` (`body_id`), + INDEX `idx_x_y` (`x`, `y`), + INDEX `idx_class` (`class`), + INDEX `idx_is_upgrading` (`is_upgrading`), + INDEX `idx_is_working` (`is_working`), + PRIMARY KEY (`id`), + CONSTRAINT `building_fk_body_id` FOREIGN KEY (`body_id`) REFERENCES `body` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `fleet`; +-- +-- Table: `fleet` +-- +CREATE TABLE `fleet` ( + `id` integer(11) NOT NULL auto_increment, + `body_id` integer NOT NULL, + `mark` varchar(10) NOT NULL, + `shipyard_id` integer NOT NULL, + `date_started` datetime NOT NULL, + `date_available` datetime NOT NULL, + `type` varchar(30) NOT NULL, + `task` varchar(30) NOT NULL, + `name` varchar(30) NOT NULL, + `speed` integer NOT NULL, + `stealth` integer NOT NULL, + `combat` integer NOT NULL, + `hold_size` integer NOT NULL, + `payload` mediumblob NULL, + `roundtrip` tinyint NOT NULL DEFAULT '0', + `direction` varchar(3) NOT NULL, + `foreign_body_id` integer NULL, + `foreign_star_id` integer NULL, + `fleet_speed` integer NOT NULL, + `berth_level` integer NOT NULL, + INDEX `fleet_idx_body_id` (`body_id`), + INDEX `fleet_idx_foreign_body_id` (`foreign_body_id`), + INDEX `fleet_idx_foreign_star_id` (`foreign_star_id`), + PRIMARY KEY (`id`), + CONSTRAINT `fleet_fk_body_id` FOREIGN KEY (`body_id`) REFERENCES `body` (`id`), + CONSTRAINT `fleet_fk_foreign_body_id` FOREIGN KEY (`foreign_body_id`) REFERENCES `body` (`id`), + CONSTRAINT `fleet_fk_foreign_star_id` FOREIGN KEY (`foreign_star_id`) REFERENCES `star` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `glyph`; +-- +-- Table: `glyph` +-- +CREATE TABLE `glyph` ( + `id` integer(11) NOT NULL auto_increment, + `body_id` integer NOT NULL, + `type` varchar(20) NOT NULL, + `quantity` integer NOT NULL DEFAULT 0, + INDEX `glyph_idx_body_id` (`body_id`), + PRIMARY KEY (`id`), + CONSTRAINT `glyph_fk_body_id` FOREIGN KEY (`body_id`) REFERENCES `body` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `invite`; +-- +-- Table: `invite` +-- +CREATE TABLE `invite` ( + `id` integer(11) NOT NULL auto_increment, + `inviter_id` integer NOT NULL, + `zone` varchar(16) NOT NULL, + `invitee_id` integer NULL, + `email` varchar(255) NULL, + `code` varchar(36) NOT NULL, + `invite_date` datetime NOT NULL, + `accept_date` datetime NOT NULL, + INDEX `invite_idx_invitee_id` (`invitee_id`), + INDEX `invite_idx_inviter_id` (`inviter_id`), + PRIMARY KEY (`id`), + CONSTRAINT `invite_fk_invitee_id` FOREIGN KEY (`invitee_id`) REFERENCES `empire` (`id`), + CONSTRAINT `invite_fk_inviter_id` FOREIGN KEY (`inviter_id`) REFERENCES `empire` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `laws`; +-- +-- Table: `laws` +-- +CREATE TABLE `laws` ( + `id` integer(11) NOT NULL auto_increment, + `name` varchar(30) NOT NULL, + `station_id` integer(11) NOT NULL, + `description` text NULL, + `type` varchar(30) NOT NULL, + `scratch` mediumblob NULL, + `date_enacted` datetime NOT NULL, + `star_id` integer NULL, + INDEX `laws_idx_star_id` (`star_id`), + INDEX `laws_idx_station_id` (`station_id`), + INDEX `idx_date_enacted` (`date_enacted`), + PRIMARY KEY (`id`), + CONSTRAINT `laws_fk_star_id` FOREIGN KEY (`star_id`) REFERENCES `star` (`id`) ON DELETE SET NULL, + CONSTRAINT `laws_fk_station_id` FOREIGN KEY (`station_id`) REFERENCES `body` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `medals`; +-- +-- Table: `medals` +-- +CREATE TABLE `medals` ( + `id` integer(11) NOT NULL auto_increment, + `type` varchar(30) NOT NULL, + `empire_id` integer(11) NOT NULL, + `public` tinyint NOT NULL DEFAULT '1', + `datestamp` datetime NOT NULL, + `times_earned` integer(11) NOT NULL DEFAULT 1, + INDEX `medals_idx_empire_id` (`empire_id`), + PRIMARY KEY (`id`), + CONSTRAINT `medals_fk_empire_id` FOREIGN KEY (`empire_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `mercenary_market`; +-- +-- Table: `mercenary_market` +-- +CREATE TABLE `mercenary_market` ( + `id` integer(11) NOT NULL auto_increment, + `date_offered` datetime NOT NULL, + `body_id` integer NOT NULL, + `ship_id` integer NOT NULL, + `ask` float(11, 1) NOT NULL, + `cost` float(11, 1) NOT NULL, + `payload` mediumblob NULL, + INDEX `mercenary_market_idx_body_id` (`body_id`), + PRIMARY KEY (`id`), + CONSTRAINT `mercenary_market_fk_body_id` FOREIGN KEY (`body_id`) REFERENCES `body` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `mining_platforms`; +-- +-- Table: `mining_platforms` +-- +CREATE TABLE `mining_platforms` ( + `id` integer(11) NOT NULL auto_increment, + `planet_id` integer(11) NOT NULL, + `asteroid_id` integer(11) NOT NULL, + `rutile_hour` integer(11) NOT NULL DEFAULT 0, + `chromite_hour` integer(11) NOT NULL DEFAULT 0, + `chalcopyrite_hour` integer(11) NOT NULL DEFAULT 0, + `galena_hour` integer(11) NOT NULL DEFAULT 0, + `gold_hour` integer(11) NOT NULL DEFAULT 0, + `uraninite_hour` integer(11) NOT NULL DEFAULT 0, + `bauxite_hour` integer(11) NOT NULL DEFAULT 0, + `goethite_hour` integer(11) NOT NULL DEFAULT 0, + `halite_hour` integer(11) NOT NULL DEFAULT 0, + `gypsum_hour` integer(11) NOT NULL DEFAULT 0, + `trona_hour` integer(11) NOT NULL DEFAULT 0, + `kerogen_hour` integer(11) NOT NULL DEFAULT 0, + `methane_hour` integer(11) NOT NULL DEFAULT 0, + `anthracite_hour` integer(11) NOT NULL DEFAULT 0, + `sulfur_hour` integer(11) NOT NULL DEFAULT 0, + `zircon_hour` integer(11) NOT NULL DEFAULT 0, + `monazite_hour` integer(11) NOT NULL DEFAULT 0, + `fluorite_hour` integer(11) NOT NULL DEFAULT 0, + `beryl_hour` integer(11) NOT NULL DEFAULT 0, + `magnetite_hour` integer(11) NOT NULL DEFAULT 0, + `percent_ship_capacity` integer NOT NULL DEFAULT -1, + INDEX `mining_platforms_idx_asteroid_id` (`asteroid_id`), + INDEX `mining_platforms_idx_planet_id` (`planet_id`), + PRIMARY KEY (`id`), + CONSTRAINT `mining_platforms_fk_asteroid_id` FOREIGN KEY (`asteroid_id`) REFERENCES `body` (`id`), + CONSTRAINT `mining_platforms_fk_planet_id` FOREIGN KEY (`planet_id`) REFERENCES `body` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `plan`; +-- +-- Table: `plan` +-- +CREATE TABLE `plan` ( + `id` integer(11) NOT NULL auto_increment, + `body_id` integer(11) NOT NULL, + `class` varchar(255) NOT NULL, + `level` tinyint NOT NULL, + `extra_build_level` tinyint NULL DEFAULT 0, + `quantity` integer(11) NOT NULL, + INDEX `plan_idx_body_id` (`body_id`), + PRIMARY KEY (`id`), + CONSTRAINT `plan_fk_body_id` FOREIGN KEY (`body_id`) REFERENCES `body` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `ships`; +-- +-- Table: `ships` +-- +CREATE TABLE `ships` ( + `id` integer(11) NOT NULL auto_increment, + `body_id` integer NOT NULL, + `shipyard_id` integer NOT NULL, + `date_started` datetime NOT NULL, + `date_available` datetime NOT NULL, + `type` varchar(30) NOT NULL, + `task` varchar(30) NOT NULL, + `name` varchar(30) NOT NULL, + `speed` integer NOT NULL, + `stealth` integer NOT NULL, + `combat` integer NOT NULL, + `hold_size` integer NOT NULL, + `payload` mediumblob NULL, + `roundtrip` tinyint NOT NULL DEFAULT '0', + `direction` varchar(3) NOT NULL, + `foreign_body_id` integer NULL, + `foreign_star_id` integer NULL, + `fleet_speed` integer NOT NULL, + `berth_level` integer NOT NULL, + `number_of_docks` integer NULL, + INDEX `ships_idx_body_id` (`body_id`), + INDEX `ships_idx_foreign_body_id` (`foreign_body_id`), + INDEX `ships_idx_foreign_star_id` (`foreign_star_id`), + INDEX `idx_shiptype` (`type`), + PRIMARY KEY (`id`), + CONSTRAINT `ships_fk_body_id` FOREIGN KEY (`body_id`) REFERENCES `body` (`id`), + CONSTRAINT `ships_fk_foreign_body_id` FOREIGN KEY (`foreign_body_id`) REFERENCES `body` (`id`), + CONSTRAINT `ships_fk_foreign_star_id` FOREIGN KEY (`foreign_star_id`) REFERENCES `star` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `sitter_auths`; +-- +-- Table: `sitter_auths` +-- +CREATE TABLE `sitter_auths` ( + `baby_id` integer NOT NULL, + `sitter_id` integer NOT NULL, + `expiry` datetime NOT NULL, + INDEX `sitter_auths_idx_baby_id` (`baby_id`), + INDEX `sitter_auths_idx_sitter_id` (`sitter_id`), + PRIMARY KEY (`baby_id`, `sitter_id`), + CONSTRAINT `sitter_auths_fk_baby_id` FOREIGN KEY (`baby_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `sitter_auths_fk_sitter_id` FOREIGN KEY (`sitter_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `stationinfluence`; +-- +-- Table: `stationinfluence` +-- +CREATE TABLE `stationinfluence` ( + `id` integer(11) NOT NULL auto_increment, + `station_id` integer NOT NULL, + `star_id` integer NOT NULL, + `alliance_id` integer NOT NULL, + `oldinfluence` integer NOT NULL, + `oldstart` datetime NOT NULL, + `influence` integer NOT NULL, + `started_influence` datetime NOT NULL, + INDEX `stationinfluence_idx_alliance_id` (`alliance_id`), + INDEX `stationinfluence_idx_star_id` (`star_id`), + INDEX `stationinfluence_idx_station_id` (`station_id`), + PRIMARY KEY (`id`), + CONSTRAINT `stationinfluence_fk_alliance_id` FOREIGN KEY (`alliance_id`) REFERENCES `alliance` (`id`), + CONSTRAINT `stationinfluence_fk_star_id` FOREIGN KEY (`star_id`) REFERENCES `star` (`id`), + CONSTRAINT `stationinfluence_fk_station_id` FOREIGN KEY (`station_id`) REFERENCES `body` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `survey`; +-- +-- Table: `survey` +-- +CREATE TABLE `survey` ( + `empire_id` integer NOT NULL, + `choice` integer NULL, + `comment` text NULL, + INDEX (`empire_id`), + PRIMARY KEY (`empire_id`), + CONSTRAINT `survey_fk_empire_id` FOREIGN KEY (`empire_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `waste_chain`; +-- +-- Table: `waste_chain` +-- +CREATE TABLE `waste_chain` ( + `id` integer(11) NOT NULL auto_increment, + `planet_id` integer(11) NOT NULL, + `star_id` integer(11) NOT NULL, + `waste_hour` integer(11) NOT NULL DEFAULT 0, + `percent_transferred` integer(11) NOT NULL DEFAULT 0, + INDEX `waste_chain_idx_planet_id` (`planet_id`), + INDEX `waste_chain_idx_star_id` (`star_id`), + PRIMARY KEY (`id`), + CONSTRAINT `waste_chain_fk_planet_id` FOREIGN KEY (`planet_id`) REFERENCES `body` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `waste_chain_fk_star_id` FOREIGN KEY (`star_id`) REFERENCES `star` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `excavators`; +-- +-- Table: `excavators` +-- +CREATE TABLE `excavators` ( + `id` integer(11) NOT NULL auto_increment, + `planet_id` integer(11) NOT NULL, + `body_id` integer(11) NOT NULL, + `empire_id` integer(11) NOT NULL, + `date_landed` datetime NOT NULL, + INDEX `excavators_idx_body_id` (`body_id`), + INDEX `excavators_idx_empire_id` (`empire_id`), + INDEX `excavators_idx_planet_id` (`planet_id`), + PRIMARY KEY (`id`), + CONSTRAINT `excavators_fk_body_id` FOREIGN KEY (`body_id`) REFERENCES `body` (`id`), + CONSTRAINT `excavators_fk_empire_id` FOREIGN KEY (`empire_id`) REFERENCES `empire` (`id`), + CONSTRAINT `excavators_fk_planet_id` FOREIGN KEY (`planet_id`) REFERENCES `body` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `market`; +-- +-- Table: `market` +-- +CREATE TABLE `market` ( + `id` integer(11) NOT NULL auto_increment, + `date_offered` datetime NOT NULL, + `body_id` integer NOT NULL, + `transfer_type` varchar(16) NOT NULL, + `ship_id` integer NULL, + `ask` float(11, 1) NOT NULL, + `payload` mediumblob NULL, + `offer_cargo_space_needed` integer NOT NULL DEFAULT 0, + `has_water` tinyint NOT NULL DEFAULT 0, + `has_energy` tinyint NOT NULL DEFAULT 0, + `has_food` tinyint NOT NULL DEFAULT 0, + `has_waste` tinyint NOT NULL DEFAULT 0, + `has_ore` tinyint NOT NULL DEFAULT 0, + `has_ship` tinyint NOT NULL DEFAULT 0, + `has_prisoner` tinyint NOT NULL DEFAULT 0, + `has_glyph` tinyint NOT NULL DEFAULT 0, + `has_plan` tinyint NOT NULL DEFAULT 0, + `x` integer NOT NULL DEFAULT 0, + `y` integer NOT NULL DEFAULT 0, + `speed` integer NOT NULL DEFAULT 0, + `trade_range` integer NOT NULL DEFAULT 0, + `max_university` integer NULL, + INDEX `market_idx_body_id` (`body_id`), + INDEX `market_idx_ship_id` (`ship_id`), + INDEX `idx_market_zone` (`body_id`, `transfer_type`), + PRIMARY KEY (`id`), + CONSTRAINT `market_fk_body_id` FOREIGN KEY (`body_id`) REFERENCES `body` (`id`), + CONSTRAINT `market_fk_ship_id` FOREIGN KEY (`ship_id`) REFERENCES `ships` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `probes`; +-- +-- Table: `probes` +-- +CREATE TABLE `probes` ( + `id` integer(11) NOT NULL auto_increment, + `empire_id` integer NOT NULL, + `star_id` integer NOT NULL, + `body_id` integer NOT NULL, + `alliance_id` integer NULL, + `virtual` integer NULL DEFAULT 0, + INDEX `probes_idx_alliance_id` (`alliance_id`), + INDEX `probes_idx_body_id` (`body_id`), + INDEX `probes_idx_empire_id` (`empire_id`), + INDEX `probes_idx_star_id` (`star_id`), + PRIMARY KEY (`id`), + CONSTRAINT `probes_fk_alliance_id` FOREIGN KEY (`alliance_id`) REFERENCES `alliance` (`id`), + CONSTRAINT `probes_fk_body_id` FOREIGN KEY (`body_id`) REFERENCES `body` (`id`), + CONSTRAINT `probes_fk_empire_id` FOREIGN KEY (`empire_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `probes_fk_star_id` FOREIGN KEY (`star_id`) REFERENCES `star` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `propositions`; +-- +-- Table: `propositions` +-- +CREATE TABLE `propositions` ( + `id` integer(11) NOT NULL auto_increment, + `name` varchar(30) NOT NULL, + `station_id` integer(11) NOT NULL, + `description` text NULL, + `type` varchar(30) NOT NULL, + `scratch` mediumblob NULL, + `date_ends` datetime NOT NULL, + `proposed_by_id` integer(11) NOT NULL, + `status` varchar(10) NOT NULL DEFAULT 'Pending', + INDEX `propositions_idx_proposed_by_id` (`proposed_by_id`), + INDEX `propositions_idx_station_id` (`station_id`), + INDEX `idx_status_date_ends` (`status`, `date_ends`), + PRIMARY KEY (`id`), + CONSTRAINT `propositions_fk_proposed_by_id` FOREIGN KEY (`proposed_by_id`) REFERENCES `empire` (`id`), + CONSTRAINT `propositions_fk_station_id` FOREIGN KEY (`station_id`) REFERENCES `body` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `spies`; +-- +-- Table: `spies` +-- +CREATE TABLE `spies` ( + `id` integer(11) NOT NULL auto_increment, + `empire_id` integer NOT NULL, + `name` varchar(30) NOT NULL DEFAULT 'Agent Null', + `from_body_id` integer NOT NULL, + `on_body_id` integer NOT NULL, + `task` varchar(30) NOT NULL DEFAULT 'Idle', + `started_assignment` datetime NOT NULL, + `available_on` datetime NOT NULL, + `offense` integer NOT NULL DEFAULT 1, + `defense` integer NOT NULL DEFAULT 1, + `date_created` datetime NOT NULL, + `offense_mission_count` integer NOT NULL DEFAULT 0, + `defense_mission_count` integer NOT NULL DEFAULT 0, + `offense_mission_successes` integer NOT NULL DEFAULT 0, + `defense_mission_successes` integer NOT NULL DEFAULT 0, + `times_captured` integer NOT NULL DEFAULT 0, + `times_turned` integer NOT NULL DEFAULT 0, + `seeds_planted` integer NOT NULL DEFAULT 0, + `spies_killed` integer NOT NULL DEFAULT 0, + `spies_captured` integer NOT NULL DEFAULT 0, + `spies_turned` integer NOT NULL DEFAULT 0, + `things_destroyed` integer NOT NULL DEFAULT 0, + `things_stolen` integer NOT NULL DEFAULT 0, + `intel_xp` integer NOT NULL DEFAULT 0, + `mayhem_xp` integer NOT NULL DEFAULT 0, + `politics_xp` integer NOT NULL DEFAULT 0, + `theft_xp` integer NOT NULL DEFAULT 0, + `level` tinyint NOT NULL DEFAULT 0, + `next_task` varchar(30) NOT NULL DEFAULT 'Idle', + INDEX `spies_idx_empire_id` (`empire_id`), + INDEX `spies_idx_from_body_id` (`from_body_id`), + INDEX `spies_idx_on_body_id` (`on_body_id`), + PRIMARY KEY (`id`), + CONSTRAINT `spies_fk_empire_id` FOREIGN KEY (`empire_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `spies_fk_from_body_id` FOREIGN KEY (`from_body_id`) REFERENCES `body` (`id`), + CONSTRAINT `spies_fk_on_body_id` FOREIGN KEY (`on_body_id`) REFERENCES `body` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `supply_chain`; +-- +-- Table: `supply_chain` +-- +CREATE TABLE `supply_chain` ( + `id` integer(11) NOT NULL auto_increment, + `planet_id` integer(11) NOT NULL, + `building_id` integer(11) NOT NULL, + `target_id` integer(11) NOT NULL, + `resource_hour` integer(11) NOT NULL DEFAULT 0, + `resource_type` varchar(255) NOT NULL DEFAULT '', + `percent_transferred` integer(11) NOT NULL DEFAULT 0, + `stalled` integer(11) NOT NULL DEFAULT 0, + INDEX `supply_chain_idx_building_id` (`building_id`), + INDEX `supply_chain_idx_planet_id` (`planet_id`), + INDEX `supply_chain_idx_target_id` (`target_id`), + PRIMARY KEY (`id`), + CONSTRAINT `supply_chain_fk_building_id` FOREIGN KEY (`building_id`) REFERENCES `building` (`id`), + CONSTRAINT `supply_chain_fk_planet_id` FOREIGN KEY (`planet_id`) REFERENCES `body` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `supply_chain_fk_target_id` FOREIGN KEY (`target_id`) REFERENCES `body` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `taxes`; +-- +-- Table: `taxes` +-- +CREATE TABLE `taxes` ( + `id` integer(11) NOT NULL auto_increment, + `empire_id` integer(11) NOT NULL, + `station_id` integer(11) NOT NULL, + `paid_6` integer(11) NOT NULL, + `paid_5` integer(11) NOT NULL, + `paid_4` integer(11) NOT NULL, + `paid_3` integer(11) NOT NULL, + `paid_2` integer(11) NOT NULL, + `paid_1` integer(11) NOT NULL, + `paid_0` integer(11) NOT NULL, + INDEX `taxes_idx_empire_id` (`empire_id`), + INDEX `taxes_idx_station_id` (`station_id`), + PRIMARY KEY (`id`), + CONSTRAINT `taxes_fk_empire_id` FOREIGN KEY (`empire_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `taxes_fk_station_id` FOREIGN KEY (`station_id`) REFERENCES `body` (`id`) +) ENGINE=InnoDB; +DROP TABLE IF EXISTS `votes`; +-- +-- Table: `votes` +-- +CREATE TABLE `votes` ( + `id` integer(11) NOT NULL auto_increment, + `proposition_id` integer NOT NULL, + `empire_id` integer NOT NULL, + `vote` integer NOT NULL DEFAULT 0, + INDEX `votes_idx_empire_id` (`empire_id`), + INDEX `votes_idx_proposition_id` (`proposition_id`), + PRIMARY KEY (`id`), + CONSTRAINT `votes_fk_empire_id` FOREIGN KEY (`empire_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `votes_fk_proposition_id` FOREIGN KEY (`proposition_id`) REFERENCES `propositions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; +SET foreign_key_checks=1; diff --git a/var/ddl/_source/deploy/1/001-auto-__VERSION.yml b/var/ddl/_source/deploy/1/001-auto-__VERSION.yml new file mode 100644 index 00000000..79d6ee7e --- /dev/null +++ b/var/ddl/_source/deploy/1/001-auto-__VERSION.yml @@ -0,0 +1,91 @@ +--- +schema: + procedures: {} + tables: + dbix_class_deploymenthandler_versions: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - version + match_type: '' + name: dbix_class_deploymenthandler_versions_version + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: UNIQUE + fields: + ddl: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: ddl + order: 3 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 0 + upgrade_sql: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: upgrade_sql + order: 4 + size: + - 0 + version: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 1 + name: version + order: 2 + size: + - 50 + indices: [] + name: dbix_class_deploymenthandler_versions + options: [] + order: 1 + triggers: {} + views: {} +translator: + add_drop_table: 1 + filename: ~ + no_comments: 0 + parser_args: + sources: + - __VERSION + parser_type: SQL::Translator::Parser::DBIx::Class + producer_args: {} + producer_type: SQL::Translator::Producer::YAML + show_warnings: 0 + trace: 0 + version: 1.66 diff --git a/var/ddl/_source/deploy/1/001-auto.yml b/var/ddl/_source/deploy/1/001-auto.yml new file mode 100644 index 00000000..96dba5f1 --- /dev/null +++ b/var/ddl/_source/deploy/1/001-auto.yml @@ -0,0 +1,11053 @@ +--- +schema: + procedures: {} + tables: + ai_battle_summary: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - attacking_empire_id + match_type: '' + name: ai_battle_summary_fk_attacking_empire_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - defending_empire_id + match_type: '' + name: ai_battle_summary_fk_defending_empire_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + fields: + attack_spy_hours: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attack_spy_hours + order: 6 + size: + - 11 + attack_victories: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attack_victories + order: 4 + size: + - 11 + attacking_empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attacking_empire_id + order: 2 + size: + - 11 + defending_empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defending_empire_id + order: 3 + size: + - 11 + defense_victories: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_victories + order: 5 + size: + - 11 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + indices: + - fields: + - attacking_empire_id + name: ai_battle_summary_idx_attacking_empire_id + options: [] + type: NORMAL + - fields: + - defending_empire_id + name: ai_battle_summary_idx_defending_empire_id + options: [] + type: NORMAL + name: ai_battle_summary + options: [] + order: 34 + ai_scratch_pad: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - ai_empire_id + match_type: '' + name: ai_scratch_pad_fk_ai_empire_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + fields: + ai_empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: ai_empire_id + order: 2 + size: + - 11 + body_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 3 + size: + - 11 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + pad: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: pad + order: 4 + size: + - 0 + indices: + - fields: + - ai_empire_id + name: ai_scratch_pad_idx_ai_empire_id + options: [] + type: NORMAL + name: ai_scratch_pad + options: [] + order: 35 + alliance: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - leader_id + match_type: '' + name: alliance_fk_leader_id + on_delete: SET NULL + on_update: '' + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + fields: + announcements: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: announcements + order: 6 + size: + - 0 + date_created: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_created + order: 7 + size: + - 0 + description: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: description + order: 5 + size: + - 0 + forum_uri: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: forum_uri + order: 4 + size: + - 255 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + image: + data_type: varchar + default_value: default + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: image + order: 9 + size: + - 255 + leader_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: leader_id + order: 3 + size: + - 11 + name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: name + order: 2 + size: + - 30 + stash: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: stash + order: 8 + size: + - 0 + indices: + - fields: + - leader_id + name: alliance_idx_leader_id + options: [] + type: NORMAL + name: alliance + options: [] + order: 29 + alliance_invite: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - alliance_id + match_type: '' + name: alliance_invite_fk_alliance_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: alliance + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - empire_id + match_type: '' + name: alliance_invite_fk_empire_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + fields: + alliance_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: alliance_id + order: 2 + size: + - 0 + date_created: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_created + order: 4 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + indices: + - fields: + - alliance_id + name: alliance_invite_idx_alliance_id + options: [] + type: NORMAL + - fields: + - empire_id + name: alliance_invite_idx_empire_id + options: [] + type: NORMAL + name: alliance_invite + options: [] + order: 36 + alliance_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + alliance_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: alliance_id + order: 3 + size: + - 0 + alliance_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: alliance_name + order: 4 + size: + - 30 + average_building_level: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: average_building_level + order: 17 + size: + - 5 + - 2 + average_empire_size: + data_type: bigint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: average_empire_size + order: 13 + size: + - 0 + average_empire_size_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: average_empire_size_rank + order: 14 + size: + - 0 + average_university_level: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: average_university_level + order: 15 + size: + - 5 + - 2 + building_count: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: building_count + order: 16 + size: + - 0 + colony_count: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: colony_count + order: 10 + size: + - 0 + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + defense_success_rate: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_success_rate + order: 21 + size: + - 6 + - 6 + defense_success_rate_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_success_rate_rank + order: 22 + size: + - 11 + dirtiest: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: dirtiest + order: 23 + size: + - 11 + dirtiest_rank: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: dirtiest_rank + order: 24 + size: + - 11 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + influence: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: influence + order: 8 + size: + - 0 + influence_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: influence_rank + order: 9 + size: + - 0 + member_count: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: member_count + order: 5 + size: + - 0 + offense_success_rate: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense_success_rate + order: 19 + size: + - 6 + - 6 + offense_success_rate_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense_success_rate_rank + order: 20 + size: + - 11 + population: + data_type: bigint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: population + order: 11 + size: + - 0 + population_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: population_rank + order: 12 + size: + - 0 + space_station_count: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: space_station_count + order: 6 + size: + - 0 + space_station_count_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: space_station_count_rank + order: 7 + size: + - 0 + spy_count: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spy_count + order: 18 + size: + - 11 + indices: + - fields: + - average_empire_size_rank + name: idx_average_empire_size_rank + options: [] + type: NORMAL + - fields: + - offense_success_rate_rank + name: idx_offense_success_rate_rank + options: [] + type: NORMAL + - fields: + - defense_success_rate_rank + name: idx_defense_success_rate_rank + options: [] + type: NORMAL + - fields: + - dirtiest_rank + name: idx_dirtiest_rank + options: [] + type: NORMAL + - fields: + - population_rank + name: idx_population_rank + options: [] + type: NORMAL + - fields: + - influence_rank + name: idx_influence_rank + options: [] + type: NORMAL + name: alliance_log + options: [] + order: 1 + api_key: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + email: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: email + order: 7 + size: + - 255 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + ip_address: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: ip_address + order: 6 + size: + - 15 + name: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: name + order: 5 + size: + - 30 + private_key: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: private_key + order: 4 + size: + - 36 + public_key: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: public_key + order: 3 + size: + - 36 + indices: + - fields: + - private_key + name: idx_private_key + options: [] + type: NORMAL + - fields: + - public_key + name: idx_public_key + options: [] + type: NORMAL + name: api_key + options: [] + order: 2 + battle_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + attacked_body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attacked_body_id + order: 18 + size: + - 11 + attacked_body_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attacked_body_name + order: 19 + size: + - 30 + attacked_empire_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: attacked_empire_id + order: 20 + size: + - 11 + attacked_empire_name: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: attacked_empire_name + order: 21 + size: + - 30 + attacking_body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attacking_body_id + order: 5 + size: + - 11 + attacking_body_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attacking_body_name + order: 6 + size: + - 30 + attacking_empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attacking_empire_id + order: 3 + size: + - 11 + attacking_empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attacking_empire_name + order: 4 + size: + - 30 + attacking_number: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attacking_number + order: 9 + size: + - 11 + attacking_type: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attacking_type + order: 8 + size: + - 60 + attacking_unit_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: attacking_unit_name + order: 7 + size: + - 60 + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + defending_body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defending_body_id + order: 12 + size: + - 11 + defending_body_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defending_body_name + order: 13 + size: + - 30 + defending_empire_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: defending_empire_id + order: 10 + size: + - 11 + defending_empire_name: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: defending_empire_name + order: 11 + size: + - 30 + defending_number: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defending_number + order: 16 + size: + - 11 + defending_type: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defending_type + order: 15 + size: + - 60 + defending_unit_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defending_unit_name + order: 14 + size: + - 60 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + victory_to: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: victory_to + order: 17 + size: + - 8 + indices: + - fields: + - date_stamp + name: idx_datestamp + options: [] + type: NORMAL + - fields: + - attacking_empire_id + name: idx_attacking_empire_id + options: [] + type: NORMAL + - fields: + - attacking_empire_name + name: idx_attacking_empire_name + options: [] + type: NORMAL + - fields: + - attacking_body_id + name: idx_attacking_body_id + options: [] + type: NORMAL + - fields: + - attacking_body_name + name: idx_attacking_body_name + options: [] + type: NORMAL + - fields: + - defending_empire_id + name: idx_defending_empire_id + options: [] + type: NORMAL + - fields: + - defending_empire_name + name: idx_defending_empire_name + options: [] + type: NORMAL + - fields: + - defending_body_id + name: idx_defending_body_id + options: [] + type: NORMAL + - fields: + - defending_body_name + name: idx_defending_body_name + options: [] + type: NORMAL + name: battle_log + options: [] + order: 3 + body: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - alliance_id + match_type: '' + name: body_fk_alliance_id + on_delete: SET NULL + on_update: '' + options: [] + reference_fields: + - id + reference_table: alliance + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - empire_id + match_type: '' + name: body_fk_empire_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - star_id + match_type: '' + name: body_fk_star_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: star + type: FOREIGN KEY + fields: + algae_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: algae_production_hour + order: 84 + size: + - 0 + algae_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: algae_stored + order: 108 + size: + - 0 + alliance_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: alliance_id + order: 7 + size: + - 0 + anthracite_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: anthracite_hour + order: 60 + size: + - 0 + anthracite_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: anthracite_stored + order: 40 + size: + - 0 + apple_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: apple_production_hour + order: 72 + size: + - 0 + apple_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: apple_stored + order: 96 + size: + - 0 + bauxite_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: bauxite_hour + order: 53 + size: + - 0 + bauxite_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: bauxite_stored + order: 33 + size: + - 0 + bean_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: bean_production_hour + order: 90 + size: + - 0 + bean_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: bean_stored + order: 93 + size: + - 0 + beetle_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: beetle_production_hour + order: 89 + size: + - 0 + beetle_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: beetle_stored + order: 113 + size: + - 0 + beryl_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: beryl_hour + order: 65 + size: + - 0 + beryl_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: beryl_stored + order: 45 + size: + - 0 + boost_enabled: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: boost_enabled + order: 114 + size: + - 0 + bread_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: bread_production_hour + order: 77 + size: + - 0 + bread_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: bread_stored + order: 101 + size: + - 0 + burger_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: burger_production_hour + order: 87 + size: + - 0 + burger_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: burger_stored + order: 111 + size: + - 0 + chalcopyrite_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: chalcopyrite_hour + order: 49 + size: + - 0 + chalcopyrite_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: chalcopyrite_stored + order: 29 + size: + - 0 + cheese_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: cheese_production_hour + order: 91 + size: + - 0 + cheese_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: cheese_stored + order: 92 + size: + - 0 + chip_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: chip_production_hour + order: 79 + size: + - 0 + chip_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: chip_stored + order: 103 + size: + - 0 + chromite_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: chromite_hour + order: 48 + size: + - 0 + chromite_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: chromite_stored + order: 28 + size: + - 0 + cider_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: cider_production_hour + order: 75 + size: + - 0 + cider_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: cider_stored + order: 99 + size: + - 0 + class: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: class + order: 9 + size: + - 255 + corn_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: corn_production_hour + order: 74 + size: + - 0 + corn_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: corn_stored + order: 98 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 13 + size: + - 0 + energy_capacity: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: energy_capacity + order: 22 + size: + - 0 + energy_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: energy_hour + order: 20 + size: + - 0 + energy_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: energy_stored + order: 21 + size: + - 0 + fluorite_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: fluorite_hour + order: 64 + size: + - 0 + fluorite_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: fluorite_stored + order: 44 + size: + - 0 + food_capacity: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: food_capacity + order: 68 + size: + - 0 + food_consumption_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: food_consumption_hour + order: 69 + size: + - 0 + fungus_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: fungus_production_hour + order: 86 + size: + - 0 + fungus_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: fungus_stored + order: 110 + size: + - 0 + galena_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: galena_hour + order: 50 + size: + - 0 + galena_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: galena_stored + order: 30 + size: + - 0 + goethite_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: goethite_hour + order: 54 + size: + - 0 + goethite_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: goethite_stored + order: 34 + size: + - 0 + gold_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: gold_hour + order: 51 + size: + - 0 + gold_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: gold_stored + order: 31 + size: + - 0 + gypsum_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: gypsum_hour + order: 56 + size: + - 0 + gypsum_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: gypsum_stored + order: 36 + size: + - 0 + halite_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: halite_hour + order: 55 + size: + - 0 + halite_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: halite_stored + order: 35 + size: + - 0 + happiness: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: happiness + order: 16 + size: + - 0 + happiness_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: happiness_hour + order: 15 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + kerogen_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: kerogen_hour + order: 58 + size: + - 0 + kerogen_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: kerogen_stored + order: 38 + size: + - 0 + lapis_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: lapis_production_hour + order: 70 + size: + - 0 + lapis_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: lapis_stored + order: 94 + size: + - 0 + last_tick: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: last_tick + order: 14 + size: + - 0 + magnetite_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: magnetite_hour + order: 66 + size: + - 0 + magnetite_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: magnetite_stored + order: 46 + size: + - 0 + max_berth: + data_type: tinyint + default_value: 1 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: max_berth + order: 120 + size: + - 0 + meal_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: meal_production_hour + order: 83 + size: + - 0 + meal_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: meal_stored + order: 107 + size: + - 0 + methane_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: methane_hour + order: 59 + size: + - 0 + methane_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: methane_stored + order: 39 + size: + - 0 + milk_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: milk_production_hour + order: 82 + size: + - 0 + milk_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: milk_stored + order: 106 + size: + - 0 + monazite_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: monazite_hour + order: 63 + size: + - 0 + monazite_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: monazite_stored + order: 43 + size: + - 0 + name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: name + order: 2 + size: + - 30 + needs_recalc: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: needs_recalc + order: 115 + size: + - 0 + needs_surface_refresh: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: needs_surface_refresh + order: 116 + size: + - 0 + neutral_entry: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: neutral_entry + order: 124 + size: + - 0 + notes: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: notes + order: 125 + size: + - 0 + orbit: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: orbit + order: 8 + size: + - 0 + ore_capacity: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: ore_capacity + order: 26 + size: + - 0 + ore_consumption_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: ore_consumption_hour + order: 67 + size: + - 0 + pancake_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: pancake_production_hour + order: 81 + size: + - 0 + pancake_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: pancake_stored + order: 105 + size: + - 0 + pie_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: pie_production_hour + order: 80 + size: + - 0 + pie_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: pie_stored + order: 104 + size: + - 0 + plots_available: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: plots_available + order: 118 + size: + - 0 + potato_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: potato_production_hour + order: 71 + size: + - 0 + potato_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: potato_stored + order: 95 + size: + - 0 + propaganda_boost: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: propaganda_boost + order: 123 + size: + - 0 + restrict_coverage: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: restrict_coverage + order: 117 + size: + - 0 + root_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: root_production_hour + order: 73 + size: + - 0 + root_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: root_stored + order: 97 + size: + - 0 + rutile_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: rutile_hour + order: 47 + size: + - 0 + rutile_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: rutile_stored + order: 27 + size: + - 0 + shake_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: shake_production_hour + order: 88 + size: + - 0 + shake_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: shake_stored + order: 112 + size: + - 0 + size: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: size + order: 10 + size: + - 0 + soup_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: soup_production_hour + order: 78 + size: + - 0 + soup_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: soup_stored + order: 102 + size: + - 0 + star_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: star_id + order: 6 + size: + - 0 + sulfur_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: sulfur_hour + order: 61 + size: + - 0 + sulfur_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: sulfur_stored + order: 41 + size: + - 0 + surface_version: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: surface_version + order: 119 + size: + - 0 + syrup_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: syrup_production_hour + order: 85 + size: + - 0 + syrup_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: syrup_stored + order: 109 + size: + - 0 + trona_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: trona_hour + order: 57 + size: + - 0 + trona_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: trona_stored + order: 37 + size: + - 0 + unhappy: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: unhappy + order: 122 + size: + - 0 + unhappy_date: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: unhappy_date + order: 121 + size: + - 0 + uraninite_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: uraninite_hour + order: 52 + size: + - 0 + uraninite_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: uraninite_stored + order: 32 + size: + - 0 + usable_as_starter: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: usable_as_starter + order: 11 + size: + - 0 + usable_as_starter_enabled: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: usable_as_starter_enabled + order: 12 + size: + - 0 + waste_capacity: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: waste_capacity + order: 19 + size: + - 0 + waste_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: waste_hour + order: 17 + size: + - 0 + waste_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: waste_stored + order: 18 + size: + - 0 + water_capacity: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: water_capacity + order: 25 + size: + - 0 + water_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: water_hour + order: 23 + size: + - 0 + water_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: water_stored + order: 24 + size: + - 0 + wheat_production_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: wheat_production_hour + order: 76 + size: + - 0 + wheat_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: wheat_stored + order: 100 + size: + - 0 + x: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: x + order: 3 + size: + - 11 + y: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: y + order: 4 + size: + - 11 + zircon_hour: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: zircon_hour + order: 62 + size: + - 0 + zircon_stored: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: zircon_stored + order: 42 + size: + - 0 + zone: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: zone + order: 5 + size: + - 16 + indices: + - fields: + - alliance_id + name: body_idx_alliance_id + options: [] + type: NORMAL + - fields: + - empire_id + name: body_idx_empire_id + options: [] + type: NORMAL + - fields: + - star_id + name: body_idx_star_id + options: [] + type: NORMAL + - fields: + - x + - y + name: idx_x_y + options: [] + type: NORMAL + - fields: + - zone + name: idx_zone + options: [] + type: NORMAL + - fields: + - name + name: idx_name + options: [] + type: NORMAL + - fields: + - class + name: idx_class + options: [] + type: NORMAL + - fields: + - usable_as_starter + name: idx_usable_as_starter + options: [] + type: NORMAL + - fields: + - usable_as_starter_enabled + name: idx_usable_as_starter_enabled + options: [] + type: NORMAL + - fields: + - usable_as_starter_enabled + - usable_as_starter + name: idx_planet_search + options: [] + type: NORMAL + name: body + options: [] + order: 32 + building: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - body_id + match_type: '' + name: building_fk_body_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 3 + size: + - 11 + class: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: class + order: 7 + size: + - 255 + date_created: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_created + order: 2 + size: + - 0 + efficiency: + data_type: int + default_value: 100 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: efficiency + order: 15 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + is_upgrading: + data_type: bit + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: is_upgrading + order: 10 + size: + - 0 + is_working: + data_type: bit + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: is_working + order: 13 + size: + - 0 + last_check: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: last_check + order: 16 + size: + - 0 + level: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: level + order: 6 + size: + - 11 + upgrade_ends: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: upgrade_ends + order: 9 + size: + - 0 + upgrade_started: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: upgrade_started + order: 8 + size: + - 0 + work: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: work + order: 14 + size: + - 0 + work_ends: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: work_ends + order: 12 + size: + - 0 + work_started: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: work_started + order: 11 + size: + - 0 + x: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: x + order: 4 + size: + - 11 + y: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: y + order: 5 + size: + - 11 + indices: + - fields: + - body_id + name: building_idx_body_id + options: [] + type: NORMAL + - fields: + - x + - y + name: idx_x_y + options: [] + type: NORMAL + - fields: + - class + name: idx_class + options: [] + type: NORMAL + - fields: + - is_upgrading + name: idx_is_upgrading + options: [] + type: NORMAL + - fields: + - is_working + name: idx_is_working + options: [] + type: NORMAL + name: building + options: [] + order: 37 + captcha: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + created: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: created + order: 5 + size: + - 0 + guid: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: guid + order: 4 + size: + - 36 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + riddle: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: riddle + order: 2 + size: + - 12 + solution: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: solution + order: 3 + size: + - 5 + indices: [] + name: captcha + options: [] + order: 4 + cargo_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 5 + size: + - 0 + data: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: data + order: 7 + size: + - 0 + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + message: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: message + order: 6 + size: + - 255 + object_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: object_id + order: 4 + size: + - 0 + object_type: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: object_type + order: 3 + size: + - 255 + indices: [] + name: cargo_log + options: [] + order: 5 + colony_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + average_building_level: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: average_building_level + order: 11 + size: + - 5 + - 2 + average_spy_success_rate: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: average_spy_success_rate + order: 20 + size: + - 6 + - 6 + body_id: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 31 + size: + - 11 + building_count: + data_type: tinyint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: building_count + order: 10 + size: + - 0 + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + defense_success_rate: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_success_rate + order: 23 + size: + - 6 + - 6 + defense_success_rate_delta: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_success_rate_delta + order: 24 + size: + - 6 + - 6 + dirtiest: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: dirtiest + order: 25 + size: + - 11 + dirtiest_delta: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: dirtiest_delta + order: 26 + size: + - 11 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + energy_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: energy_hour + order: 14 + size: + - 11 + food_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: food_hour + order: 13 + size: + - 11 + happiness_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: happiness_hour + order: 18 + size: + - 11 + highest_building_level: + data_type: tinyint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: highest_building_level + order: 12 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + influence: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: influence + order: 28 + size: + - 11 + is_space_station: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: is_space_station + order: 27 + size: + - 11 + offense_success_rate: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense_success_rate + order: 21 + size: + - 6 + - 6 + offense_success_rate_delta: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense_success_rate_delta + order: 22 + size: + - 6 + - 6 + ore_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: ore_hour + order: 16 + size: + - 11 + planet_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: planet_id + order: 5 + size: + - 11 + planet_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: planet_name + order: 6 + size: + - 30 + population: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: population + order: 7 + size: + - 11 + population_delta: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: population_delta + order: 9 + size: + - 11 + population_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: population_rank + order: 8 + size: + - 11 + spy_count: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spy_count + order: 19 + size: + - 11 + waste_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: waste_hour + order: 15 + size: + - 11 + water_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: water_hour + order: 17 + size: + - 11 + x: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: x + order: 29 + size: + - 11 + y: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: y + order: 30 + size: + - 11 + zone: + data_type: varchar + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: zone + order: 32 + size: + - 16 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + - fields: + - population_rank + name: idx_population_rank + options: [] + type: NORMAL + - fields: + - planet_id + name: idx_planet_id + options: [] + type: NORMAL + - fields: + - planet_name + name: idx_planet_name + options: [] + type: NORMAL + name: colony_log + options: [] + order: 6 + config: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: name + order: 2 + size: + - 30 + value: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: value + order: 3 + size: + - 256 + indices: + - fields: + - name + name: c_idx_key + options: [] + type: NORMAL + name: config + options: [] + order: 7 + economy_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + date_stamp: + data_type: date + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + in_mission: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: in_mission + order: 15 + size: + - 0 + in_other: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: in_other + order: 16 + size: + - 0 + in_purchase: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: in_purchase + order: 9 + size: + - 0 + in_redemption: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: in_redemption + order: 11 + size: + - 0 + in_trade: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: in_trade + order: 10 + size: + - 0 + in_tutorial: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: in_tutorial + order: 14 + size: + - 0 + in_vein: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: in_vein + order: 12 + size: + - 0 + in_vote: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: in_vote + order: 13 + size: + - 0 + out_boost: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: out_boost + order: 17 + size: + - 0 + out_building: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: out_building + order: 24 + size: + - 0 + out_delete: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: out_delete + order: 26 + size: + - 0 + out_glyph: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: out_glyph + order: 22 + size: + - 0 + out_mission: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: out_mission + order: 18 + size: + - 0 + out_other: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: out_other + order: 27 + size: + - 0 + out_party: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: out_party + order: 23 + size: + - 0 + out_recycle: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: out_recycle + order: 19 + size: + - 0 + out_ship: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: out_ship + order: 20 + size: + - 0 + out_spy: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: out_spy + order: 21 + size: + - 0 + out_trade: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: out_trade + order: 25 + size: + - 0 + purchases_100: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: purchases_100 + order: 5 + size: + - 0 + purchases_1300: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: purchases_1300 + order: 8 + size: + - 0 + purchases_200: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: purchases_200 + order: 6 + size: + - 0 + purchases_30: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: purchases_30 + order: 4 + size: + - 0 + purchases_600: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: purchases_600 + order: 7 + size: + - 0 + total_users: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: total_users + order: 3 + size: + - 0 + indices: + - fields: + - date_stamp + name: idx_date_stamp + options: [] + type: NORMAL + name: economy_log + options: [] + order: 8 + empire: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - name + match_type: '' + name: name + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: UNIQUE + - deferrable: 1 + expression: '' + fields: + - alliance_id + match_type: '' + name: empire_fk_alliance_id + on_delete: SET NULL + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: alliance + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - home_planet_id + match_type: '' + name: empire_fk_home_planet_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - latest_message_id + match_type: '' + name: empire_fk_latest_message_id + on_delete: SET NULL + on_update: '' + options: [] + reference_fields: + - id + reference_table: message + type: FOREIGN KEY + fields: + alliance_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: alliance_id + order: 35 + size: + - 0 + building_boost: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: building_boost + order: 33 + size: + - 0 + city: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: city + order: 14 + size: + - 100 + country: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: country + order: 15 + size: + - 100 + date_created: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_created + order: 4 + size: + - 0 + deception_affinity: + data_type: tinyint + default_value: 4 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: deception_affinity + order: 41 + size: + - 0 + description: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: description + order: 7 + size: + - 0 + dont_replace_excavator: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: dont_replace_excavator + order: 67 + size: + - 0 + email: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: email + order: 13 + size: + - 255 + energy_boost: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: energy_boost + order: 31 + size: + - 0 + environmental_affinity: + data_type: tinyint + default_value: 4 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: environmental_affinity + order: 47 + size: + - 0 + essentia_free: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: essentia_free + order: 20 + size: + - 11 + - 1 + essentia_game: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: essentia_game + order: 21 + size: + - 11 + - 1 + essentia_paid: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: essentia_paid + order: 22 + size: + - 11 + - 1 + farming_affinity: + data_type: tinyint + default_value: 4 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: farming_affinity + order: 44 + size: + - 0 + food_boost: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: food_boost + order: 28 + size: + - 0 + growth_affinity: + data_type: tinyint + default_value: 4 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: growth_affinity + order: 50 + size: + - 0 + happiness_boost: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: happiness_boost + order: 32 + size: + - 0 + home_planet_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: home_planet_id + order: 9 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + in_stasis: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: in_stasis + order: 70 + size: + - 0 + is_admin: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: is_admin + order: 55 + size: + - 0 + is_isolationist: + data_type: tinyint + default_value: 1 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: is_isolationist + order: 26 + size: + - 0 + is_mission_curator: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: is_mission_curator + order: 56 + size: + - 0 + last_login: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: last_login + order: 19 + size: + - 0 + latest_message_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: latest_message_id + order: 68 + size: + - 0 + management_affinity: + data_type: tinyint + default_value: 4 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: management_affinity + order: 43 + size: + - 0 + manufacturing_affinity: + data_type: tinyint + default_value: 4 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: manufacturing_affinity + order: 40 + size: + - 0 + max_orbit: + data_type: tinyint + default_value: 3 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: max_orbit + order: 39 + size: + - 0 + min_orbit: + data_type: tinyint + default_value: 3 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: min_orbit + order: 38 + size: + - 0 + mining_affinity: + data_type: tinyint + default_value: 4 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: mining_affinity + order: 45 + size: + - 0 + name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 1 + name: name + order: 2 + size: + - 30 + notes: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: notes + order: 8 + size: + - 0 + ore_boost: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: ore_boost + order: 30 + size: + - 0 + outlaw: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: outlaw + order: 72 + size: + - 0 + outlaw_date: + data_type: datetime + default_value: 2010-10-03 18:17:26 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: outlaw_date + order: 73 + size: + - 0 + password: + data_type: char + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: password + order: 11 + size: + - 43 + password_recovery_key: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: password_recovery_key + order: 18 + size: + - 36 + player_name: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: player_name + order: 17 + size: + - 100 + political_affinity: + data_type: tinyint + default_value: 4 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: political_affinity + order: 48 + size: + - 0 + research_affinity: + data_type: tinyint + default_value: 4 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: research_affinity + order: 42 + size: + - 0 + science_affinity: + data_type: tinyint + default_value: 4 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: science_affinity + order: 46 + size: + - 0 + self_destruct_active: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: self_destruct_active + order: 6 + size: + - 0 + self_destruct_date: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: self_destruct_date + order: 5 + size: + - 0 + sitter_password: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: sitter_password + order: 12 + size: + - 30 + skip_attack_messages: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_attack_messages + order: 63 + size: + - 0 + skip_excavator_artifact: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_excavator_artifact + order: 64 + size: + - 0 + skip_excavator_destroyed: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_excavator_destroyed + order: 65 + size: + - 0 + skip_excavator_glyph: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_excavator_glyph + order: 59 + size: + - 0 + skip_excavator_plan: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_excavator_plan + order: 60 + size: + - 0 + skip_excavator_replace_msg: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_excavator_replace_msg + order: 66 + size: + - 0 + skip_excavator_resources: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_excavator_resources + order: 58 + size: + - 0 + skip_found_nothing: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_found_nothing + order: 57 + size: + - 0 + skip_happiness_warnings: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_happiness_warnings + order: 54 + size: + - 0 + skip_incoming_ships: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_incoming_ships + order: 69 + size: + - 0 + skip_medal_messages: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_medal_messages + order: 51 + size: + - 0 + skip_pollution_warnings: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_pollution_warnings + order: 52 + size: + - 0 + skip_probe_detected: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_probe_detected + order: 62 + size: + - 0 + skip_resource_warnings: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_resource_warnings + order: 53 + size: + - 0 + skip_spy_recovery: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_spy_recovery + order: 61 + size: + - 0 + skype: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: skype + order: 16 + size: + - 100 + species_description: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: species_description + order: 37 + size: + - 0 + species_name: + data_type: varchar + default_value: Human + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: species_name + order: 36 + size: + - 30 + spy_training_boost: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spy_training_boost + order: 34 + size: + - 0 + stage: + data_type: varchar + default_value: new + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: stage + order: 3 + size: + - 30 + status_message: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: status_message + order: 10 + size: + - 255 + storage_boost: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: storage_boost + order: 27 + size: + - 0 + timeout: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: timeout + order: 71 + size: + - 0 + trade_affinity: + data_type: tinyint + default_value: 4 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: trade_affinity + order: 49 + size: + - 0 + tutorial_scratch: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: tutorial_scratch + order: 25 + size: + - 0 + tutorial_stage: + data_type: varchar + default_value: explore_the_ui + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: tutorial_stage + order: 24 + size: + - 30 + university_level: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: university_level + order: 23 + size: + - 0 + water_boost: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: water_boost + order: 29 + size: + - 0 + indices: + - fields: + - alliance_id + name: empire_idx_alliance_id + options: [] + type: NORMAL + - fields: + - home_planet_id + name: empire_idx_home_planet_id + options: [] + type: NORMAL + - fields: + - latest_message_id + name: empire_idx_latest_message_id + options: [] + type: NORMAL + - fields: + - self_destruct_active + - self_destruct_date + name: idx_self_destruct + options: [] + type: NORMAL + - fields: + - password_recovery_key + name: idx_password_recovery_key + options: [] + type: NORMAL + - fields: + - last_login + - self_destruct_active + name: idx_inactives + options: [] + type: NORMAL + - fields: + - name + - is_admin + name: idx_admins + options: [] + type: NORMAL + name: empire + options: [] + order: 33 + empire_admin_notes: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + creator: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: creator + order: 6 + size: + - 30 + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + notes: + data_type: text + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: notes + order: 5 + size: + - 0 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + name: empire_admin_notes + options: [] + order: 9 + empire_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + alliance_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: alliance_id + order: 33 + size: + - 0 + alliance_name: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: alliance_name + order: 34 + size: + - 30 + average_building_level: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: average_building_level + order: 15 + size: + - 5 + - 2 + building_count: + data_type: smallint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: building_count + order: 12 + size: + - 0 + colony_count: + data_type: tinyint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: colony_count + order: 5 + size: + - 0 + colony_count_delta: + data_type: tinyint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: colony_count_delta + order: 6 + size: + - 0 + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + defense_success_rate: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_success_rate + order: 27 + size: + - 6 + - 6 + defense_success_rate_delta: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_success_rate_delta + order: 29 + size: + - 6 + - 6 + defense_success_rate_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_success_rate_rank + order: 28 + size: + - 11 + dirtiest: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: dirtiest + order: 30 + size: + - 11 + dirtiest_delta: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: dirtiest_delta + order: 32 + size: + - 11 + dirtiest_rank: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: dirtiest_rank + order: 31 + size: + - 11 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + empire_size: + data_type: bigint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_size + order: 9 + size: + - 11 + empire_size_delta: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_size_delta + order: 10 + size: + - 11 + empire_size_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_size_rank + order: 11 + size: + - 11 + energy_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: energy_hour + order: 18 + size: + - 11 + food_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: food_hour + order: 17 + size: + - 11 + happiness_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: happiness_hour + order: 22 + size: + - 11 + highest_building_level: + data_type: tinyint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: highest_building_level + order: 16 + size: + - 3 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + influence: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: influence + order: 36 + size: + - 11 + offense_success_rate: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense_success_rate + order: 24 + size: + - 6 + - 6 + offense_success_rate_delta: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense_success_rate_delta + order: 26 + size: + - 6 + - 6 + offense_success_rate_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense_success_rate_rank + order: 25 + size: + - 11 + ore_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: ore_hour + order: 20 + size: + - 11 + population: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: population + order: 7 + size: + - 11 + population_delta: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: population_delta + order: 8 + size: + - 11 + space_station_count: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: space_station_count + order: 35 + size: + - 11 + spy_count: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spy_count + order: 23 + size: + - 11 + university_level: + data_type: tinyint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: university_level + order: 13 + size: + - 0 + university_level_rank: + data_type: tinyint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: university_level_rank + order: 14 + size: + - 0 + waste_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: waste_hour + order: 19 + size: + - 11 + water_hour: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: water_hour + order: 21 + size: + - 11 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + - fields: + - empire_size_rank + name: idx_empire_size_rank + options: [] + type: NORMAL + - fields: + - university_level_rank + name: idx_university_level_rank + options: [] + type: NORMAL + - fields: + - offense_success_rate_rank + name: idx_offense_success_rate_rank + options: [] + type: NORMAL + - fields: + - defense_success_rate_rank + name: idx_defense_success_rate_rank + options: [] + type: NORMAL + - fields: + - dirtiest_rank + name: idx_dirtiest_rank + options: [] + type: NORMAL + name: empire_log + options: [] + order: 10 + empire_name_change_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + old_empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: old_empire_name + order: 5 + size: + - 30 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + name: empire_name_change_log + options: [] + order: 11 + empire_rpc_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + limits: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: limits + order: 6 + size: + - 11 + rpc: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: rpc + order: 5 + size: + - 11 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + name: empire_rpc_log + options: [] + order: 12 + essentia_code: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + amount: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: amount + order: 3 + size: + - 11 + - 1 + code: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: code + order: 2 + size: + - 36 + date_created: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_created + order: 4 + size: + - 0 + description: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: description + order: 5 + size: + - 50 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 7 + size: + - 11 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + used: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: used + order: 6 + size: + - 0 + indices: + - fields: + - code + name: idx_code + options: [] + type: NORMAL + name: essentia_code + options: [] + order: 13 + essentia_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + amount: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: amount + order: 6 + size: + - 11 + - 1 + api_key: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: api_key + order: 5 + size: + - 40 + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + description: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: description + order: 7 + size: + - 90 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + from_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: from_id + order: 9 + size: + - 11 + from_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: from_name + order: 10 + size: + - 30 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + transaction_id: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: transaction_id + order: 8 + size: + - 36 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + - fields: + - api_key + name: idx_api_key + options: [] + type: NORMAL + - fields: + - transaction_id + name: idx_transaction_id + options: [] + type: NORMAL + - fields: + - empire_id + - description + - amount + name: idx_essentiacode + options: [] + type: NORMAL + name: essentia_log + options: [] + order: 14 + excavators: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - body_id + match_type: '' + name: excavators_fk_body_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - empire_id + match_type: '' + name: excavators_fk_empire_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - planet_id + match_type: '' + name: excavators_fk_planet_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 3 + size: + - 11 + date_landed: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_landed + order: 5 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 4 + size: + - 11 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + planet_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: planet_id + order: 2 + size: + - 11 + indices: + - fields: + - body_id + name: excavators_idx_body_id + options: [] + type: NORMAL + - fields: + - empire_id + name: excavators_idx_empire_id + options: [] + type: NORMAL + - fields: + - planet_id + name: excavators_idx_planet_id + options: [] + type: NORMAL + name: excavators + options: [] + order: 51 + fleet: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - body_id + match_type: '' + name: fleet_fk_body_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - foreign_body_id + match_type: '' + name: fleet_fk_foreign_body_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - foreign_star_id + match_type: '' + name: fleet_fk_foreign_star_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: star + type: FOREIGN KEY + fields: + berth_level: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: berth_level + order: 20 + size: + - 0 + body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 2 + size: + - 0 + combat: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: combat + order: 12 + size: + - 0 + date_available: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_available + order: 6 + size: + - 0 + date_started: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_started + order: 5 + size: + - 0 + direction: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: direction + order: 16 + size: + - 3 + fleet_speed: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: fleet_speed + order: 19 + size: + - 0 + foreign_body_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: foreign_body_id + order: 17 + size: + - 0 + foreign_star_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: foreign_star_id + order: 18 + size: + - 0 + hold_size: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: hold_size + order: 13 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + mark: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: mark + order: 3 + size: + - 10 + name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: name + order: 9 + size: + - 30 + payload: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: payload + order: 14 + size: + - 0 + roundtrip: + data_type: bit + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: roundtrip + order: 15 + size: + - 0 + shipyard_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: shipyard_id + order: 4 + size: + - 0 + speed: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: speed + order: 10 + size: + - 0 + stealth: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: stealth + order: 11 + size: + - 0 + task: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: task + order: 8 + size: + - 30 + type: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: type + order: 7 + size: + - 30 + indices: + - fields: + - body_id + name: fleet_idx_body_id + options: [] + type: NORMAL + - fields: + - foreign_body_id + name: fleet_idx_foreign_body_id + options: [] + type: NORMAL + - fields: + - foreign_star_id + name: fleet_idx_foreign_star_id + options: [] + type: NORMAL + name: fleet + options: [] + order: 38 + glyph: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - body_id + match_type: '' + name: glyph_fk_body_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 2 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + quantity: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: quantity + order: 4 + size: + - 0 + type: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: type + order: 3 + size: + - 20 + indices: + - fields: + - body_id + name: glyph_idx_body_id + options: [] + type: NORMAL + name: glyph + options: [] + order: 39 + invite: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - invitee_id + match_type: '' + name: invite_fk_invitee_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - inviter_id + match_type: '' + name: invite_fk_inviter_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + fields: + accept_date: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: accept_date + order: 8 + size: + - 0 + code: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: code + order: 6 + size: + - 36 + email: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: email + order: 5 + size: + - 255 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + invite_date: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: invite_date + order: 7 + size: + - 0 + invitee_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: invitee_id + order: 4 + size: + - 0 + inviter_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: inviter_id + order: 2 + size: + - 0 + zone: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: zone + order: 3 + size: + - 16 + indices: + - fields: + - invitee_id + name: invite_idx_invitee_id + options: [] + type: NORMAL + - fields: + - inviter_id + name: invite_idx_inviter_id + options: [] + type: NORMAL + name: invite + options: [] + order: 40 + laws: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - star_id + match_type: '' + name: laws_fk_star_id + on_delete: SET NULL + on_update: '' + options: [] + reference_fields: + - id + reference_table: star + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - station_id + match_type: '' + name: laws_fk_station_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + date_enacted: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_enacted + order: 7 + size: + - 0 + description: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: description + order: 4 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: name + order: 2 + size: + - 30 + scratch: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: scratch + order: 6 + size: + - 0 + star_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: star_id + order: 8 + size: + - 0 + station_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: station_id + order: 3 + size: + - 11 + type: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: type + order: 5 + size: + - 30 + indices: + - fields: + - star_id + name: laws_idx_star_id + options: [] + type: NORMAL + - fields: + - station_id + name: laws_idx_station_id + options: [] + type: NORMAL + - fields: + - date_enacted + name: idx_date_enacted + options: [] + type: NORMAL + name: laws + options: [] + order: 41 + login_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + api_key: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: api_key + order: 5 + size: + - 36 + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + extended: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: extended + order: 9 + size: + - 11 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + ip_address: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: ip_address + order: 7 + size: + - 15 + is_sitter: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: is_sitter + order: 10 + size: + - 1 + log_out_date: + data_type: datetime + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: log_out_date + order: 8 + size: + - 0 + session_id: + data_type: char + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: session_id + order: 6 + size: + - 36 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + - fields: + - api_key + name: idx_api_key + options: [] + type: NORMAL + - fields: + - session_id + name: idx_session_id + options: [] + type: NORMAL + name: login_log + options: [] + order: 15 + lottery_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + api_key: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: api_key + order: 5 + size: + - 40 + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + ip_address: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: ip_address + order: 7 + size: + - 15 + url: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: url + order: 6 + size: + - 255 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + - fields: + - api_key + name: idx_api_key + options: [] + type: NORMAL + - fields: + - url + name: idx_url + options: [] + type: NORMAL + - fields: + - ip_address + name: idx_ip_address + options: [] + type: NORMAL + name: lottery_log + options: [] + order: 16 + market: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - body_id + match_type: '' + name: market_fk_body_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - ship_id + match_type: '' + name: market_fk_ship_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: ships + type: FOREIGN KEY + fields: + ask: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: ask + order: 6 + size: + - 11 + - 1 + body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 3 + size: + - 0 + date_offered: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_offered + order: 2 + size: + - 0 + has_energy: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_energy + order: 10 + size: + - 0 + has_food: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_food + order: 11 + size: + - 0 + has_glyph: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_glyph + order: 16 + size: + - 0 + has_ore: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_ore + order: 13 + size: + - 0 + has_plan: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_plan + order: 17 + size: + - 0 + has_prisoner: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_prisoner + order: 15 + size: + - 0 + has_ship: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_ship + order: 14 + size: + - 0 + has_waste: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_waste + order: 12 + size: + - 0 + has_water: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_water + order: 9 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + max_university: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: max_university + order: 22 + size: + - 0 + offer_cargo_space_needed: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offer_cargo_space_needed + order: 8 + size: + - 0 + payload: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: payload + order: 7 + size: + - 0 + ship_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: ship_id + order: 5 + size: + - 0 + speed: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: speed + order: 20 + size: + - 0 + trade_range: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: trade_range + order: 21 + size: + - 0 + transfer_type: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: transfer_type + order: 4 + size: + - 16 + x: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: x + order: 18 + size: + - 0 + y: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: y + order: 19 + size: + - 0 + indices: + - fields: + - body_id + name: market_idx_body_id + options: [] + type: NORMAL + - fields: + - ship_id + name: market_idx_ship_id + options: [] + type: NORMAL + - fields: + - body_id + - transfer_type + name: idx_market_zone + options: [] + type: NORMAL + name: market + options: [] + order: 52 + medals: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - empire_id + match_type: '' + name: medals_fk_empire_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + fields: + datestamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: datestamp + order: 5 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + public: + data_type: bit + default_value: 1 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: public + order: 4 + size: + - 0 + times_earned: + data_type: int + default_value: 1 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: times_earned + order: 6 + size: + - 11 + type: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: type + order: 2 + size: + - 30 + indices: + - fields: + - empire_id + name: medals_idx_empire_id + options: [] + type: NORMAL + name: medals + options: [] + order: 42 + mercenary_market: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - body_id + match_type: '' + name: mercenary_market_fk_body_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + ask: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: ask + order: 5 + size: + - 11 + - 1 + body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 3 + size: + - 0 + cost: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: cost + order: 6 + size: + - 11 + - 1 + date_offered: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_offered + order: 2 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + payload: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: payload + order: 7 + size: + - 0 + ship_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: ship_id + order: 4 + size: + - 0 + indices: + - fields: + - body_id + name: mercenary_market_idx_body_id + options: [] + type: NORMAL + name: mercenary_market + options: [] + order: 43 + message: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - to_id + match_type: '' + name: message_fk_to_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - from_id + match_type: '' + name: message_fk_from_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + fields: + attachments: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: attachments + order: 16 + size: + - 0 + body: + data_type: mediumtext + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: body + order: 4 + size: + - 0 + date_sent: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_sent + order: 5 + size: + - 0 + from_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: from_id + order: 6 + size: + - 11 + from_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: from_name + order: 7 + size: + - 30 + has_archived: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_archived + order: 14 + size: + - 0 + has_read: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_read + order: 12 + size: + - 0 + has_replied: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_replied + order: 13 + size: + - 0 + has_trashed: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: has_trashed + order: 15 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + in_reply_to: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: in_reply_to + order: 2 + size: + - 11 + recipients: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: recipients + order: 10 + size: + - 0 + repeat_check: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: repeat_check + order: 17 + size: + - 30 + subject: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: subject + order: 3 + size: + - 64 + tag: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: tag + order: 11 + size: + - 15 + to_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: to_id + order: 8 + size: + - 11 + to_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: to_name + order: 9 + size: + - 30 + indices: + - fields: + - to_id + name: message_idx_to_id + options: [] + type: NORMAL + - fields: + - from_id + name: message_idx_from_id + options: [] + type: NORMAL + - fields: + - repeat_check + - date_sent + name: idx_repeat_check_date_sent + options: [] + type: NORMAL + - fields: + - has_archived + - has_read + - to_id + - date_sent + name: idx_recent_messages + options: [] + type: NORMAL + - fields: + - has_archived + - to_id + - date_sent + name: idx_inbox_only + options: [] + type: NORMAL + - fields: + - has_trashed + - to_id + - date_sent + name: idx_trash_only + options: [] + type: NORMAL + name: message + options: [] + order: 30 + mining_platforms: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - asteroid_id + match_type: '' + name: mining_platforms_fk_asteroid_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - planet_id + match_type: '' + name: mining_platforms_fk_planet_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + anthracite_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: anthracite_hour + order: 17 + size: + - 11 + asteroid_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: asteroid_id + order: 3 + size: + - 11 + bauxite_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: bauxite_hour + order: 10 + size: + - 11 + beryl_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: beryl_hour + order: 22 + size: + - 11 + chalcopyrite_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: chalcopyrite_hour + order: 6 + size: + - 11 + chromite_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: chromite_hour + order: 5 + size: + - 11 + fluorite_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: fluorite_hour + order: 21 + size: + - 11 + galena_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: galena_hour + order: 7 + size: + - 11 + goethite_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: goethite_hour + order: 11 + size: + - 11 + gold_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: gold_hour + order: 8 + size: + - 11 + gypsum_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: gypsum_hour + order: 13 + size: + - 11 + halite_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: halite_hour + order: 12 + size: + - 11 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + kerogen_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: kerogen_hour + order: 15 + size: + - 11 + magnetite_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: magnetite_hour + order: 23 + size: + - 11 + methane_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: methane_hour + order: 16 + size: + - 11 + monazite_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: monazite_hour + order: 20 + size: + - 11 + percent_ship_capacity: + data_type: int + default_value: -1 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: percent_ship_capacity + order: 24 + size: + - 0 + planet_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: planet_id + order: 2 + size: + - 11 + rutile_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: rutile_hour + order: 4 + size: + - 11 + sulfur_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: sulfur_hour + order: 18 + size: + - 11 + trona_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: trona_hour + order: 14 + size: + - 11 + uraninite_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: uraninite_hour + order: 9 + size: + - 11 + zircon_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: zircon_hour + order: 19 + size: + - 11 + indices: + - fields: + - asteroid_id + name: mining_platforms_idx_asteroid_id + options: [] + type: NORMAL + - fields: + - planet_id + name: mining_platforms_idx_planet_id + options: [] + type: NORMAL + name: mining_platforms + options: [] + order: 44 + mission: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + date_posted: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_posted + order: 4 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + max_university_level: + data_type: tinyint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: max_university_level + order: 5 + size: + - 0 + mission_file_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: mission_file_name + order: 2 + size: + - 100 + scratch: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: scratch + order: 6 + size: + - 0 + zone: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: zone + order: 3 + size: + - 16 + indices: + - fields: + - zone + - date_posted + name: idx_zone_date_posted + options: [] + type: NORMAL + name: mission + options: [] + order: 17 + mission_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + complete_uni_level: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: complete_uni_level + order: 7 + size: + - 0 + completes: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: completes + order: 6 + size: + - 0 + filename: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: filename + order: 2 + size: + - 255 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + incompletes: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: incompletes + order: 9 + size: + - 0 + offers: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offers + order: 3 + size: + - 0 + seconds_to_complete: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: seconds_to_complete + order: 8 + size: + - 0 + skip_uni_level: + data_type: bigint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skip_uni_level + order: 5 + size: + - 0 + skips: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: skips + order: 4 + size: + - 0 + indices: [] + name: mission_log + options: [] + order: 18 + news: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + date_posted: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_posted + order: 4 + size: + - 0 + headline: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: headline + order: 2 + size: + - 140 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + zone: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: zone + order: 3 + size: + - 16 + indices: + - fields: + - zone + - date_posted + name: idx_zone_date_posted + options: [] + type: NORMAL + - fields: + - date_posted + name: idx_date_posted + options: [] + type: NORMAL + name: news + options: [] + order: 19 + noexist_with_empire_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + name: noexist_with_empire_log + options: [] + order: 22 + plan: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - body_id + match_type: '' + name: plan_fk_body_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 2 + size: + - 11 + class: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: class + order: 3 + size: + - 255 + extra_build_level: + data_type: tinyint + default_value: 0 + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: extra_build_level + order: 5 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + level: + data_type: tinyint + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: level + order: 4 + size: + - 0 + quantity: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: quantity + order: 6 + size: + - 11 + indices: + - fields: + - body_id + name: plan_idx_body_id + options: [] + type: NORMAL + name: plan + options: [] + order: 45 + probes: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - alliance_id + match_type: '' + name: probes_fk_alliance_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: alliance + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - body_id + match_type: '' + name: probes_fk_body_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - empire_id + match_type: '' + name: probes_fk_empire_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - star_id + match_type: '' + name: probes_fk_star_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: star + type: FOREIGN KEY + fields: + alliance_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: alliance_id + order: 5 + size: + - 0 + body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 4 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 2 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + star_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: star_id + order: 3 + size: + - 0 + virtual: + data_type: int + default_value: 0 + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: virtual + order: 6 + size: + - 0 + indices: + - fields: + - alliance_id + name: probes_idx_alliance_id + options: [] + type: NORMAL + - fields: + - body_id + name: probes_idx_body_id + options: [] + type: NORMAL + - fields: + - empire_id + name: probes_idx_empire_id + options: [] + type: NORMAL + - fields: + - star_id + name: probes_idx_star_id + options: [] + type: NORMAL + name: probes + options: [] + order: 53 + promotion: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + end_date: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: end_date + order: 3 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + max_purchase: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: max_purchase + order: 6 + size: + - 0 + min_purchase: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: min_purchase + order: 5 + size: + - 0 + payload: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: payload + order: 7 + size: + - 0 + start_date: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: start_date + order: 2 + size: + - 0 + type: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: type + order: 4 + size: + - 30 + indices: [] + name: promotion + options: [] + order: 23 + propositions: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - proposed_by_id + match_type: '' + name: propositions_fk_proposed_by_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - station_id + match_type: '' + name: propositions_fk_station_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + date_ends: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_ends + order: 7 + size: + - 0 + description: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: description + order: 4 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: name + order: 2 + size: + - 30 + proposed_by_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: proposed_by_id + order: 8 + size: + - 11 + scratch: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: scratch + order: 6 + size: + - 0 + station_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: station_id + order: 3 + size: + - 11 + status: + data_type: varchar + default_value: Pending + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: status + order: 9 + size: + - 10 + type: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: type + order: 5 + size: + - 30 + indices: + - fields: + - proposed_by_id + name: propositions_idx_proposed_by_id + options: [] + type: NORMAL + - fields: + - station_id + name: propositions_idx_station_id + options: [] + type: NORMAL + - fields: + - status + - date_ends + name: idx_status_date_ends + options: [] + type: NORMAL + name: propositions + options: [] + order: 54 + rpc_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + api_key: + data_type: varchar + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: api_key + order: 5 + size: + - 40 + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + module: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: module + order: 6 + size: + - 255 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + - fields: + - api_key + name: idx_api_key + options: [] + type: NORMAL + - fields: + - module + name: idx_module + options: [] + type: NORMAL + name: rpc_log + options: [] + order: 24 + schedule: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + args: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: args + order: 9 + size: + - 0 + delivery: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: delivery + order: 4 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + job_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: job_id + order: 3 + size: + - 11 + parent_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: parent_id + order: 7 + size: + - 11 + parent_table: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: parent_table + order: 6 + size: + - 30 + priority: + data_type: int + default_value: 1000 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: priority + order: 5 + size: + - 11 + queue: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: queue + order: 2 + size: + - 30 + task: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: task + order: 8 + size: + - 30 + indices: [] + name: schedule + options: [] + order: 25 + ships: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - body_id + match_type: '' + name: ships_fk_body_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - foreign_body_id + match_type: '' + name: ships_fk_foreign_body_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - foreign_star_id + match_type: '' + name: ships_fk_foreign_star_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: star + type: FOREIGN KEY + fields: + berth_level: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: berth_level + order: 19 + size: + - 0 + body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: body_id + order: 2 + size: + - 0 + combat: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: combat + order: 11 + size: + - 0 + date_available: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_available + order: 5 + size: + - 0 + date_started: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_started + order: 4 + size: + - 0 + direction: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: direction + order: 15 + size: + - 3 + fleet_speed: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: fleet_speed + order: 18 + size: + - 0 + foreign_body_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: foreign_body_id + order: 16 + size: + - 0 + foreign_star_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: foreign_star_id + order: 17 + size: + - 0 + hold_size: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: hold_size + order: 12 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: name + order: 8 + size: + - 30 + number_of_docks: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: number_of_docks + order: 20 + size: + - 0 + payload: + data_type: mediumblob + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: payload + order: 13 + size: + - 0 + roundtrip: + data_type: bit + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: roundtrip + order: 14 + size: + - 0 + shipyard_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: shipyard_id + order: 3 + size: + - 0 + speed: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: speed + order: 9 + size: + - 0 + stealth: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: stealth + order: 10 + size: + - 0 + task: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: task + order: 7 + size: + - 30 + type: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: type + order: 6 + size: + - 30 + indices: + - fields: + - body_id + name: ships_idx_body_id + options: [] + type: NORMAL + - fields: + - foreign_body_id + name: ships_idx_foreign_body_id + options: [] + type: NORMAL + - fields: + - foreign_star_id + name: ships_idx_foreign_star_id + options: [] + type: NORMAL + - fields: + - type + name: idx_shiptype + options: [] + type: NORMAL + name: ships + options: [] + order: 46 + sitter_auths: + constraints: + - deferrable: 1 + expression: '' + fields: + - baby_id + - sitter_id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - baby_id + match_type: '' + name: sitter_auths_fk_baby_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - sitter_id + match_type: '' + name: sitter_auths_fk_sitter_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + fields: + baby_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: baby_id + order: 1 + size: + - 0 + expiry: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: expiry + order: 3 + size: + - 0 + sitter_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: sitter_id + order: 2 + size: + - 0 + indices: + - fields: + - baby_id + name: sitter_auths_idx_baby_id + options: [] + type: NORMAL + - fields: + - sitter_id + name: sitter_auths_idx_sitter_id + options: [] + type: NORMAL + name: sitter_auths + options: [] + order: 47 + spies: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - empire_id + match_type: '' + name: spies_fk_empire_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - from_body_id + match_type: '' + name: spies_fk_from_body_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - on_body_id + match_type: '' + name: spies_fk_on_body_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + available_on: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: available_on + order: 8 + size: + - 0 + date_created: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_created + order: 11 + size: + - 0 + defense: + data_type: int + default_value: 1 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense + order: 10 + size: + - 0 + defense_mission_count: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_mission_count + order: 13 + size: + - 0 + defense_mission_successes: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_mission_successes + order: 15 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 2 + size: + - 0 + from_body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: from_body_id + order: 4 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + intel_xp: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: intel_xp + order: 24 + size: + - 0 + level: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: level + order: 28 + size: + - 0 + mayhem_xp: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: mayhem_xp + order: 25 + size: + - 0 + name: + data_type: varchar + default_value: Agent Null + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: name + order: 3 + size: + - 30 + next_task: + data_type: varchar + default_value: Idle + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: next_task + order: 29 + size: + - 30 + offense: + data_type: int + default_value: 1 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense + order: 9 + size: + - 0 + offense_mission_count: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense_mission_count + order: 12 + size: + - 0 + offense_mission_successes: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense_mission_successes + order: 14 + size: + - 0 + on_body_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: on_body_id + order: 5 + size: + - 0 + politics_xp: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: politics_xp + order: 26 + size: + - 0 + seeds_planted: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: seeds_planted + order: 18 + size: + - 0 + spies_captured: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spies_captured + order: 20 + size: + - 0 + spies_killed: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spies_killed + order: 19 + size: + - 0 + spies_turned: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spies_turned + order: 21 + size: + - 0 + started_assignment: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: started_assignment + order: 7 + size: + - 0 + task: + data_type: varchar + default_value: Idle + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: task + order: 6 + size: + - 30 + theft_xp: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: theft_xp + order: 27 + size: + - 0 + things_destroyed: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: things_destroyed + order: 22 + size: + - 0 + things_stolen: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: things_stolen + order: 23 + size: + - 0 + times_captured: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: times_captured + order: 16 + size: + - 0 + times_turned: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: times_turned + order: 17 + size: + - 0 + indices: + - fields: + - empire_id + name: spies_idx_empire_id + options: [] + type: NORMAL + - fields: + - from_body_id + name: spies_idx_from_body_id + options: [] + type: NORMAL + - fields: + - on_body_id + name: spies_idx_on_body_id + options: [] + type: NORMAL + name: spies + options: [] + order: 55 + spy_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + age: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: age + order: 19 + size: + - 11 + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + defense_success_rate: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_success_rate + order: 14 + size: + - 6 + - 6 + defense_success_rate_delta: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: defense_success_rate_delta + order: 15 + size: + - 6 + - 6 + dirtiest: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: dirtiest + order: 28 + size: + - 11 + dirtiest_delta: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: dirtiest_delta + order: 30 + size: + - 11 + dirtiest_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: dirtiest_rank + order: 29 + size: + - 11 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + level: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: level + order: 9 + size: + - 11 + level_delta: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: level_delta + order: 11 + size: + - 11 + level_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: level_rank + order: 10 + size: + - 11 + offense_success_rate: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense_success_rate + order: 12 + size: + - 6 + - 6 + offense_success_rate_delta: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: offense_success_rate_delta + order: 13 + size: + - 6 + - 6 + planet_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: planet_id + order: 8 + size: + - 11 + planet_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: planet_name + order: 7 + size: + - 30 + seeds_planted: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: seeds_planted + order: 22 + size: + - 11 + spies_captured: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spies_captured + order: 24 + size: + - 11 + spies_killed: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spies_killed + order: 23 + size: + - 11 + spies_turned: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spies_turned + order: 25 + size: + - 11 + spy_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spy_id + order: 6 + size: + - 11 + spy_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: spy_name + order: 5 + size: + - 30 + success_rate: + data_type: float + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: success_rate + order: 16 + size: + - 6 + - 6 + success_rate_delta: + data_type: float + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: success_rate_delta + order: 18 + size: + - 6 + - 6 + success_rate_rank: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: success_rate_rank + order: 17 + size: + - 11 + things_destroyed: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: things_destroyed + order: 26 + size: + - 11 + things_stolen: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: things_stolen + order: 27 + size: + - 11 + times_captured: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: times_captured + order: 20 + size: + - 11 + times_turned: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: times_turned + order: 21 + size: + - 11 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + - fields: + - level_rank + name: idx_level_rank + options: [] + type: NORMAL + - fields: + - success_rate_rank + name: idx_success_rate_rank + options: [] + type: NORMAL + - fields: + - dirtiest_rank + name: idx_dirtiest_rank + options: [] + type: NORMAL + - fields: + - planet_id + name: idx_planet_id + options: [] + type: NORMAL + - fields: + - planet_name + name: idx_planet_name + options: [] + type: NORMAL + - fields: + - spy_id + name: idx_spy_id + options: [] + type: NORMAL + - fields: + - spy_name + name: idx_spy_name + options: [] + type: NORMAL + name: spy_log + options: [] + order: 26 + star: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - station_id + match_type: '' + name: star_fk_station_id + on_delete: SET NULL + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + color: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: color + order: 6 + size: + - 7 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + influence: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: influence + order: 8 + size: + - 0 + name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: name + order: 2 + size: + - 30 + needs_recalc: + data_type: tinyint + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: needs_recalc + order: 9 + size: + - 0 + station_id: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: station_id + order: 7 + size: + - 0 + x: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: x + order: 3 + size: + - 11 + y: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: y + order: 4 + size: + - 11 + zone: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: zone + order: 5 + size: + - 16 + indices: + - fields: + - station_id + name: star_idx_station_id + options: [] + type: NORMAL + - fields: + - needs_recalc + name: idx_recalc + options: [] + type: NORMAL + name: star + options: [] + order: 31 + stationinfluence: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - alliance_id + match_type: '' + name: stationinfluence_fk_alliance_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: alliance + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - star_id + match_type: '' + name: stationinfluence_fk_star_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: star + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - station_id + match_type: '' + name: stationinfluence_fk_station_id + on_delete: CASCADE + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + alliance_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: alliance_id + order: 4 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + influence: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: influence + order: 7 + size: + - 0 + oldinfluence: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: oldinfluence + order: 5 + size: + - 0 + oldstart: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: oldstart + order: 6 + size: + - 0 + star_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: star_id + order: 3 + size: + - 0 + started_influence: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: started_influence + order: 8 + size: + - 0 + station_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: station_id + order: 2 + size: + - 0 + indices: + - fields: + - alliance_id + name: stationinfluence_idx_alliance_id + options: [] + type: NORMAL + - fields: + - star_id + name: stationinfluence_idx_star_id + options: [] + type: NORMAL + - fields: + - station_id + name: stationinfluence_idx_station_id + options: [] + type: NORMAL + name: stationinfluence + options: [] + order: 48 + supply_chain: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - building_id + match_type: '' + name: supply_chain_fk_building_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: building + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - planet_id + match_type: '' + name: supply_chain_fk_planet_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - target_id + match_type: '' + name: supply_chain_fk_target_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + building_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: building_id + order: 3 + size: + - 11 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + percent_transferred: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: percent_transferred + order: 7 + size: + - 11 + planet_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: planet_id + order: 2 + size: + - 11 + resource_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: resource_hour + order: 5 + size: + - 11 + resource_type: + data_type: varchar + default_value: '' + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: resource_type + order: 6 + size: + - 0 + stalled: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: stalled + order: 8 + size: + - 11 + target_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: target_id + order: 4 + size: + - 11 + indices: + - fields: + - building_id + name: supply_chain_idx_building_id + options: [] + type: NORMAL + - fields: + - planet_id + name: supply_chain_idx_planet_id + options: [] + type: NORMAL + - fields: + - target_id + name: supply_chain_idx_target_id + options: [] + type: NORMAL + name: supply_chain + options: [] + order: 56 + survey: + constraints: + - deferrable: 1 + expression: '' + fields: + - empire_id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - empire_id + match_type: '' + name: survey_fk_empire_id + on_delete: CASCADE + on_update: '' + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + fields: + choice: + data_type: int + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: choice + order: 2 + size: + - 0 + comment: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: comment + order: 3 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: empire_id + order: 1 + size: + - 0 + indices: [] + name: survey + options: [] + order: 49 + taxes: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - empire_id + match_type: '' + name: taxes_fk_empire_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - station_id + match_type: '' + name: taxes_fk_station_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + fields: + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 2 + size: + - 11 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + paid_0: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: paid_0 + order: 10 + size: + - 11 + paid_1: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: paid_1 + order: 9 + size: + - 11 + paid_2: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: paid_2 + order: 8 + size: + - 11 + paid_3: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: paid_3 + order: 7 + size: + - 11 + paid_4: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: paid_4 + order: 6 + size: + - 11 + paid_5: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: paid_5 + order: 5 + size: + - 11 + paid_6: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: paid_6 + order: 4 + size: + - 11 + station_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: station_id + order: 3 + size: + - 11 + indices: + - fields: + - empire_id + name: taxes_idx_empire_id + options: [] + type: NORMAL + - fields: + - station_id + name: taxes_idx_station_id + options: [] + type: NORMAL + name: taxes + options: [] + order: 57 + viral_log: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + abandons: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: abandons + order: 8 + size: + - 0 + accepts: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: accepts + order: 6 + size: + - 0 + active_duration: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: active_duration + order: 9 + size: + - 0 + creates: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: creates + order: 4 + size: + - 0 + date_stamp: + data_type: date + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + deletes: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: deletes + order: 7 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + invites: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: invites + order: 5 + size: + - 0 + total_users: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: total_users + order: 3 + size: + - 0 + indices: + - fields: + - date_stamp + name: idx_date_stamp + options: [] + type: NORMAL + name: viral_log + options: [] + order: 27 + votes: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - empire_id + match_type: '' + name: votes_fk_empire_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: empire + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - proposition_id + match_type: '' + name: votes_fk_proposition_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: propositions + type: FOREIGN KEY + fields: + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + proposition_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: proposition_id + order: 2 + size: + - 0 + vote: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: vote + order: 4 + size: + - 0 + indices: + - fields: + - empire_id + name: votes_idx_empire_id + options: [] + type: NORMAL + - fields: + - proposition_id + name: votes_idx_proposition_id + options: [] + type: NORMAL + name: votes + options: [] + order: 58 + waste_chain: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - planet_id + match_type: '' + name: waste_chain_fk_planet_id + on_delete: CASCADE + on_update: CASCADE + options: [] + reference_fields: + - id + reference_table: body + type: FOREIGN KEY + - deferrable: 1 + expression: '' + fields: + - star_id + match_type: '' + name: waste_chain_fk_star_id + on_delete: '' + on_update: '' + options: [] + reference_fields: + - id + reference_table: star + type: FOREIGN KEY + fields: + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + percent_transferred: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: percent_transferred + order: 5 + size: + - 11 + planet_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: planet_id + order: 2 + size: + - 11 + star_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: star_id + order: 3 + size: + - 11 + waste_hour: + data_type: int + default_value: 0 + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: waste_hour + order: 4 + size: + - 11 + indices: + - fields: + - planet_id + name: waste_chain_idx_planet_id + options: [] + type: NORMAL + - fields: + - star_id + name: waste_chain_idx_star_id + options: [] + type: NORMAL + name: waste_chain + options: [] + order: 50 + weekly_medal_winner: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + fields: + date_stamp: + data_type: datetime + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: date_stamp + order: 2 + size: + - 0 + empire_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_id + order: 3 + size: + - 11 + empire_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: empire_name + order: 4 + size: + - 30 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 11 + medal_id: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: medal_id + order: 5 + size: + - 0 + medal_image: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: medal_image + order: 8 + size: + - 50 + medal_name: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: medal_name + order: 6 + size: + - 50 + times_earned: + data_type: int + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 0 + name: times_earned + order: 7 + size: + - 0 + indices: + - fields: + - empire_id + name: idx_empire_id + options: [] + type: NORMAL + - fields: + - empire_name + name: idx_empire_name + options: [] + type: NORMAL + name: weekly_medal_winner + options: [] + order: 28 + triggers: + stationinfluence_cleanup: + action: UPDATE star s SET s.needs_recalc = 1 WHERE s.id = OLD.star_id; + database_events: + - delete + fields: ~ + name: stationinfluence_cleanup + on_table: stationinfluence + order: 1 + perform_action_when: after + scope: row + views: {} +translator: + add_drop_table: 1 + filename: ~ + no_comments: 0 + parser_args: + sources: + - AIBattleSummary + - AIScratchPad + - Alliance + - AllianceInvite + - ApiKey + - Building + - Building::Archaeology + - Building::Capitol + - Building::CloakingLab + - Building::DeployedBleeder + - Building::Development + - Building::DistributionCenter + - Building::Embassy + - Building::Energy + - Building::Energy::Fission + - Building::Energy::Fusion + - Building::Energy::Geo + - Building::Energy::Hydrocarbon + - Building::Energy::Reserve + - Building::Energy::Singularity + - Building::Energy::Waste + - Building::EntertainmentDistrict + - Building::Espionage + - Building::Food + - Building::Food::Algae + - Building::Food::Apple + - Building::Food::Bean + - Building::Food::Beeldeban + - Building::Food::Bread + - Building::Food::Burger + - Building::Food::Cheese + - Building::Food::Chip + - Building::Food::Cider + - Building::Food::Corn + - Building::Food::CornMeal + - Building::Food::Dairy + - Building::Food::Lapis + - Building::Food::Malcud + - Building::Food::Pancake + - Building::Food::Pie + - Building::Food::Potato + - Building::Food::Reserve + - Building::Food::Root + - Building::Food::Shake + - Building::Food::Soup + - Building::Food::Syrup + - Building::Food::Wheat + - Building::GasGiantLab + - Building::GeneticsLab + - Building::IntelTraining + - Building::Intelligence + - Building::LCOTa + - Building::LCOTb + - Building::LCOTc + - Building::LCOTd + - Building::LCOTe + - Building::LCOTf + - Building::LCOTg + - Building::LCOTh + - Building::LCOTi + - Building::LuxuryHousing + - Building::MayhemTraining + - Building::MercenariesGuild + - Building::MissionCommand + - Building::Module + - Building::Module::ArtMuseum + - Building::Module::CulinaryInstitute + - Building::Module::IBS + - Building::Module::OperaHouse + - Building::Module::Parliament + - Building::Module::PoliceStation + - Building::Module::StationCommand + - Building::Module::Warehouse + - Building::MunitionsLab + - Building::Network19 + - Building::Observatory + - Building::Ore + - Building::Ore::Mine + - Building::Ore::Ministry + - Building::Ore::Refinery + - Building::Ore::Storage + - Building::Oversight + - Building::Park + - Building::Permanent + - Building::Permanent::AlgaePond + - Building::Permanent::AmalgusMeadow + - Building::Permanent::Beach1 + - Building::Permanent::Beach10 + - Building::Permanent::Beach11 + - Building::Permanent::Beach12 + - Building::Permanent::Beach13 + - Building::Permanent::Beach2 + - Building::Permanent::Beach3 + - Building::Permanent::Beach4 + - Building::Permanent::Beach5 + - Building::Permanent::Beach6 + - Building::Permanent::Beach7 + - Building::Permanent::Beach8 + - Building::Permanent::Beach9 + - Building::Permanent::BeeldebanNest + - Building::Permanent::BlackHoleGenerator + - Building::Permanent::CitadelOfKnope + - Building::Permanent::CrashedShipSite + - Building::Permanent::Crater + - Building::Permanent::DentonBrambles + - Building::Permanent::EssentiaVein + - Building::Permanent::Fissure + - Building::Permanent::GasGiantPlatform + - Building::Permanent::GeoThermalVent + - Building::Permanent::GratchsGauntlet + - Building::Permanent::GreatBallOfJunk + - Building::Permanent::Grove + - Building::Permanent::HallsOfVrbansk + - Building::Permanent::InterDimensionalRift + - Building::Permanent::JunkHengeSculpture + - Building::Permanent::KalavianRuins + - Building::Permanent::KasternsKeep + - Building::Permanent::Lagoon + - Building::Permanent::Lake + - Building::Permanent::LapisForest + - Building::Permanent::LibraryOfJith + - Building::Permanent::MalcudField + - Building::Permanent::MassadsHenge + - Building::Permanent::MetalJunkArches + - Building::Permanent::NaturalSpring + - Building::Permanent::OracleOfAnid + - Building::Permanent::PantheonOfHagness + - Building::Permanent::PyramidJunkSculpture + - Building::Permanent::Ravine + - Building::Permanent::RockyOutcrop + - Building::Permanent::Sand + - Building::Permanent::SpaceJunkPark + - Building::Permanent::TempleOfTheDrajilites + - Building::Permanent::TerraformingPlatform + - Building::Permanent::TheDillonForge + - Building::Permanent::Volcano + - Building::PilotTraining + - Building::PlanetaryCommand + - Building::PoliticsTraining + - Building::Propulsion + - Building::SAW + - Building::SSLa + - Building::SSLb + - Building::SSLc + - Building::SSLd + - Building::Security + - Building::Shipyard + - Building::SpacePort + - Building::Stockpile + - Building::SubspaceSupplyDepot + - Building::SupplyPod + - Building::TerraformingLab + - Building::TheftTraining + - Building::ThemePark + - Building::Trade + - Building::Transporter + - Building::University + - Building::Waste + - Building::Waste::Digester + - Building::Waste::Exchanger + - Building::Waste::Recycling + - Building::Waste::Sequestration + - Building::Waste::Treatment + - Building::Water + - Building::Water::AtmosphericEvaporator + - Building::Water::Production + - Building::Water::Purification + - Building::Water::Reclamation + - Building::Water::Storage + - Captcha + - Config + - Empire + - EssentiaCode + - Excavators + - Fleet + - Fleet::Barge + - Fleet::Bleeder + - Fleet::CargoShip + - Fleet::ColonyShip + - Fleet::Detonator + - Fleet::Dory + - Fleet::Drone + - Fleet::Excavator + - Fleet::Fighter + - Fleet::Freighter + - Fleet::Galleon + - Fleet::GasGiantSettlementPlatformShip + - Fleet::Hulk + - Fleet::HulkFast + - Fleet::HulkHuge + - Fleet::MiningPlatformShip + - Fleet::ObservatorySeeker + - Fleet::Placebo + - Fleet::Placebo2 + - Fleet::Placebo3 + - Fleet::Placebo4 + - Fleet::Placebo5 + - Fleet::Placebo6 + - Fleet::Probe + - Fleet::Scanner + - Fleet::Scow + - Fleet::ScowFast + - Fleet::ScowLarge + - Fleet::ScowMega + - Fleet::SecurityMinistrySeeker + - Fleet::ShortRangeColonyShip + - Fleet::SmugglerShip + - Fleet::Snark + - Fleet::Snark2 + - Fleet::Snark3 + - Fleet::SpacePortSeeker + - Fleet::SpaceStation + - Fleet::SpyPod + - Fleet::SpyShuttle + - Fleet::Stake + - Fleet::SupplyPod + - Fleet::SupplyPod2 + - Fleet::SupplyPod3 + - Fleet::SupplyPod4 + - Fleet::Surveyor + - Fleet::Sweeper + - Fleet::TerraformingPlatformShip + - Fleet::Thud + - Glyph + - Invite + - Laws + - Laws::BHGNeutralized + - Laws::BHGPassport + - Laws::MembersOnlyColonization + - Laws::MembersOnlyExcavation + - Laws::MembersOnlyMiningRights + - Laws::MembersOnlyStations + - Laws::Taxation + - Laws::Writ + - Log + - Log::Alliance + - Log::Battles + - Log::Cargo + - Log::Colony + - Log::Economy + - Log::Empire + - Log::EmpireAdminNotes + - Log::EmpireNameChange + - Log::EmpireRPC + - Log::Essentia + - Log::Login + - Log::Lottery + - Log::Mission + - Log::RPC + - Log::Spies + - Log::Viral + - Log::WeeklyMedalWinner + - Log::WithEmpire + - Map + - Map::Body + - Map::Body::Asteroid + - Map::Body::Asteroid::A1 + - Map::Body::Asteroid::A10 + - Map::Body::Asteroid::A11 + - Map::Body::Asteroid::A12 + - Map::Body::Asteroid::A13 + - Map::Body::Asteroid::A14 + - Map::Body::Asteroid::A15 + - Map::Body::Asteroid::A16 + - Map::Body::Asteroid::A17 + - Map::Body::Asteroid::A18 + - Map::Body::Asteroid::A19 + - Map::Body::Asteroid::A2 + - Map::Body::Asteroid::A20 + - Map::Body::Asteroid::A21 + - Map::Body::Asteroid::A22 + - Map::Body::Asteroid::A23 + - Map::Body::Asteroid::A24 + - Map::Body::Asteroid::A25 + - Map::Body::Asteroid::A26 + - Map::Body::Asteroid::A3 + - Map::Body::Asteroid::A4 + - Map::Body::Asteroid::A5 + - Map::Body::Asteroid::A6 + - Map::Body::Asteroid::A7 + - Map::Body::Asteroid::A8 + - Map::Body::Asteroid::A9 + - Map::Body::Planet + - Map::Body::Planet::GasGiant + - Map::Body::Planet::GasGiant::G1 + - Map::Body::Planet::GasGiant::G2 + - Map::Body::Planet::GasGiant::G3 + - Map::Body::Planet::GasGiant::G4 + - Map::Body::Planet::GasGiant::G5 + - Map::Body::Planet::P1 + - Map::Body::Planet::P10 + - Map::Body::Planet::P11 + - Map::Body::Planet::P12 + - Map::Body::Planet::P13 + - Map::Body::Planet::P14 + - Map::Body::Planet::P15 + - Map::Body::Planet::P16 + - Map::Body::Planet::P17 + - Map::Body::Planet::P18 + - Map::Body::Planet::P19 + - Map::Body::Planet::P2 + - Map::Body::Planet::P20 + - Map::Body::Planet::P21 + - Map::Body::Planet::P22 + - Map::Body::Planet::P23 + - Map::Body::Planet::P24 + - Map::Body::Planet::P25 + - Map::Body::Planet::P26 + - Map::Body::Planet::P27 + - Map::Body::Planet::P28 + - Map::Body::Planet::P29 + - Map::Body::Planet::P3 + - Map::Body::Planet::P30 + - Map::Body::Planet::P31 + - Map::Body::Planet::P32 + - Map::Body::Planet::P33 + - Map::Body::Planet::P34 + - Map::Body::Planet::P35 + - Map::Body::Planet::P36 + - Map::Body::Planet::P37 + - Map::Body::Planet::P38 + - Map::Body::Planet::P39 + - Map::Body::Planet::P4 + - Map::Body::Planet::P40 + - Map::Body::Planet::P5 + - Map::Body::Planet::P6 + - Map::Body::Planet::P7 + - Map::Body::Planet::P8 + - Map::Body::Planet::P9 + - Map::Body::Planet::Station + - Map::Star + - Map::StarLite + - Market + - Medals + - MercenaryMarket + - Message + - MiningPlatforms + - Mission + - News + - Plan + - Probes + - Promotion + - Promotion::Bonus50 + - Promotion::BonusEssentia + - Promotion::ECode50 + - Promotion::EssentiaCode + - Promotion::Valentine50 + - Propositions + - Propositions::AbandonStation + - Propositions::BHGNeutralized + - Propositions::BHGPassport + - Propositions::BroadcastOnNetwork19 + - Propositions::DemolishModule + - Propositions::DowngradeModule + - Propositions::ElectNewLeader + - Propositions::EnactWrit + - Propositions::EvictExcavator + - Propositions::EvictMiningPlatform + - Propositions::ExpelMember + - Propositions::FireBfg + - Propositions::ForeignAid + - Propositions::InductMember + - Propositions::InstallModule + - Propositions::MembersOnlyColonization + - Propositions::MembersOnlyExcavation + - Propositions::MembersOnlyMiningRights + - Propositions::MembersOnlyStations + - Propositions::RenameAsteroid + - Propositions::RenameStar + - Propositions::RenameStation + - Propositions::RenameUninhabited + - Propositions::RepairModule + - Propositions::RepealLaw + - Propositions::Taxation + - Propositions::TransferStationOwnership + - Propositions::UpgradeModule + - Schedule + - Ships + - Ships::AttackGroup + - Ships::Barge + - Ships::Bleeder + - Ships::CargoShip + - Ships::ColonyShip + - Ships::Detonator + - Ships::Dory + - Ships::Drone + - Ships::Excavator + - Ships::Fighter + - Ships::FissureSealer + - Ships::Freighter + - Ships::Galleon + - Ships::GasGiantSettlementPlatformShip + - Ships::Hulk + - Ships::HulkFast + - Ships::HulkHuge + - Ships::MiningPlatformShip + - Ships::ObservatorySeeker + - Ships::Placebo + - Ships::Placebo2 + - Ships::Placebo3 + - Ships::Placebo4 + - Ships::Placebo5 + - Ships::Placebo6 + - Ships::Probe + - Ships::Scanner + - Ships::Scow + - Ships::ScowFast + - Ships::ScowLarge + - Ships::ScowMega + - Ships::SecurityMinistrySeeker + - Ships::ShortRangeColonyShip + - Ships::SmugglerShip + - Ships::Snark + - Ships::Snark2 + - Ships::Snark3 + - Ships::SpacePortSeeker + - Ships::SpaceStation + - Ships::SpyPod + - Ships::SpyShuttle + - Ships::Stake + - Ships::SupplyPod + - Ships::SupplyPod2 + - Ships::SupplyPod3 + - Ships::SupplyPod4 + - Ships::SupplyPod5 + - Ships::Surveyor + - Ships::Sweeper + - Ships::TerraformingPlatformShip + - Ships::Thud + - SitterAuths + - Spies + - StationInfluence + - SupplyChain + - Survey + - Taxes + - Votes + - WasteChain + parser_type: SQL::Translator::Parser::DBIx::Class + producer_args: {} + producer_type: SQL::Translator::Producer::YAML + show_warnings: 0 + trace: 0 + version: 1.66 diff --git a/var/upgrades/2.0400.sql b/var/upgrades/2.0400.sql deleted file mode 100644 index ed12796f..00000000 --- a/var/upgrades/2.0400.sql +++ /dev/null @@ -1,13 +0,0 @@ -alter table empire_log add column empire_size_rank int(11) not null; -alter table empire_log add column university_level_rank int(11) not null; -alter table empire_log add column offense_success_rate_rank int(11) not null; -alter table empire_log add column defense_success_rate_rank int(11) not null; -alter table empire_log add column dirtiest_rank int(11) not null; -alter table empire_log add column happiness_hour int(11) not null; -alter table empire_log add index idx_empire_size_rank (empire_size_rank); -alter table colony_log add column happiness_hour int(11) not null; -alter table colony_log add column population_rank int(11) not null; -alter table spies_log add column level_rank int(11) not null; -alter table spies_log add column success_rate_rank int(11) not null; -alter table spies_log add column dirtiest_rank int(11) not null; - diff --git a/var/upgrades/2.2000.sql b/var/upgrades/2.2000.sql deleted file mode 100644 index 75790613..00000000 --- a/var/upgrades/2.2000.sql +++ /dev/null @@ -1,37 +0,0 @@ -alter table empire add column `species_name` varchar(30) NOT NULL default 'Human'; -alter table empire add column `species_description` text; -alter table empire add column `min_orbit` tinyint(4) NOT NULL DEFAULT '3'; -alter table empire add column `max_orbit` tinyint(4) NOT NULL DEFAULT '3'; -alter table empire add column `manufacturing_affinity` tinyint(4) NOT NULL DEFAULT '4'; -alter table empire add column `deception_affinity` tinyint(4) NOT NULL DEFAULT '4'; -alter table empire add column `research_affinity` tinyint(4) NOT NULL DEFAULT '4'; -alter table empire add column `management_affinity` tinyint(4) NOT NULL DEFAULT '4'; -alter table empire add column `farming_affinity` tinyint(4) NOT NULL DEFAULT '4'; -alter table empire add column `mining_affinity` tinyint(4) NOT NULL DEFAULT '4'; -alter table empire add column `science_affinity` tinyint(4) NOT NULL DEFAULT '4'; -alter table empire add column `environmental_affinity` tinyint(4) NOT NULL DEFAULT '4'; -alter table empire add column `political_affinity` tinyint(4) NOT NULL DEFAULT '4'; -alter table empire add column `trade_affinity` tinyint(4) NOT NULL DEFAULT '4'; -alter table empire add column `growth_affinity` tinyint(4) NOT NULL DEFAULT '4'; -update empire, species set - empire.species_name = species.name, - empire.species_description = species.description, - empire.min_orbit = species.min_orbit, - empire.max_orbit = species.max_orbit, - empire.manufacturing_affinity = species.manufacturing_affinity, - empire.deception_affinity = species.deception_affinity, - empire.research_affinity = species.research_affinity, - empire.management_affinity = species.management_affinity, - empire.farming_affinity = species.farming_affinity, - empire.mining_affinity = species.mining_affinity, - empire.science_affinity = species.science_affinity, - empire.environmental_affinity = species.environmental_affinity, - empire.political_affinity = species.political_affinity, - empire.trade_affinity = species.trade_affinity, - empire.growth_affinity = species.growth_affinity - where empire.species_id=species.id; -alter table species drop key idx_empire_id; -alter table empire drop foreign key empire_fk_species_id; -alter table empire drop key empire_idx_species_id; -alter table empire drop column species_id; -drop table species; diff --git a/var/upgrades/2.2100.sql b/var/upgrades/2.2100.sql deleted file mode 100644 index 6122cf93..00000000 --- a/var/upgrades/2.2100.sql +++ /dev/null @@ -1,5 +0,0 @@ -alter table empire add column `skip_medal_messages` tinyint NOT NULL default 0; -alter table empire add column `skip_pollution_warnings` tinyint NOT NULL default 0; -alter table empire add column `skip_resource_warnings` tinyint NOT NULL default 0; -alter table empire add column `skip_happiness_warnings` tinyint NOT NULL default 0; -update ships set type='snark' where type='bomber'; \ No newline at end of file diff --git a/var/upgrades/2.2400.sql b/var/upgrades/2.2400.sql deleted file mode 100644 index a830a575..00000000 --- a/var/upgrades/2.2400.sql +++ /dev/null @@ -1,31 +0,0 @@ -alter table empire_log add column `alliance_id` int; -alter table empire_log add column `alliance_name` varchar(30); -alter table weekly_medal_winner add column `date_stamp` datetime not null; - CREATE TABLE `alliance_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `date_stamp` datetime NOT NULL, - `alliance_id` int(11) NOT NULL, - `alliance_name` varchar(30) NOT NULL, - `member_count` int(11) NOT NULL, - `space_station_count` int(11) NOT NULL, - `influence` int(11) NOT NULL, - `colony_count` int(11) NOT NULL, - `population` int(11) NOT NULL, - `average_empire_size` int(11) NOT NULL, - `average_empire_size_rank` bigint NOT NULL, - `average_university_level` float(5,2) NOT NULL, - `building_count` int(11) NOT NULL, - `average_building_level` float(5,2) NOT NULL, - `spy_count` int(11) NOT NULL, - `offense_success_rate` float(6,6) NOT NULL, - `offense_success_rate_rank` int(11) NOT NULL, - `defense_success_rate` float(6,6) NOT NULL, - `defense_success_rate_rank` int(11) NOT NULL, - `dirtiest` int(11) NOT NULL DEFAULT '0', - `dirtiest_rank` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `idx_average_empire_size_rank` (`average_empire_size_rank`), - KEY `idx_offense_success_rate_rank` (`offense_success_rate_rank`), - KEY `idx_defense_success_rate_rank` (`defense_success_rate_rank`), - KEY `idx_dirtiest_rank` (`dirtiest_rank`) -); diff --git a/var/upgrades/2.2500.sql b/var/upgrades/2.2500.sql deleted file mode 100644 index 67ab0294..00000000 --- a/var/upgrades/2.2500.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table invite add column `zone` varchar(16); -update invite,empire,body set invite.zone=body.zone where invite.inviter_id=empire.id and empire.home_planet_id=body.id; diff --git a/var/upgrades/2.2808.sql b/var/upgrades/2.2808.sql deleted file mode 100644 index 4ed755f7..00000000 --- a/var/upgrades/2.2808.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE `saben_target` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `target_empire_id` int(11) NOT NULL, - `saben_colony_id` int(11) NOT NULL, - PRIMARY KEY (`id`) -); -alter table message change recipients recipients mediumblob; -alter table message change attachments attachments mediumblob; -alter table building change `work` `work` mediumblob; -alter table ships change payload payload mediumblob; -alter table trades change payload payload mediumblob; -alter table cargo_log change `data` `data` mediumblob; diff --git a/var/upgrades/2.2900.sql b/var/upgrades/2.2900.sql deleted file mode 100644 index 6920a463..00000000 --- a/var/upgrades/2.2900.sql +++ /dev/null @@ -1 +0,0 @@ -alter table body add column `plots_available` tinyint; diff --git a/var/upgrades/2.4000.sql b/var/upgrades/2.4000.sql deleted file mode 100644 index fbf43f65..00000000 --- a/var/upgrades/2.4000.sql +++ /dev/null @@ -1,10 +0,0 @@ -alter table ships add column combat int default 0; -update ships set combat=2000 where type='snark'; -update ships set combat=200 where type='scanner'; -update ships set combat=2500 where type='observatory_seeker'; -update ships set combat=3500 where type='security_ministry_seeker'; -update ships set combat=3000 where type='spaceport_seeker'; -update ships set combat=6000 where type='drone'; -update ships set combat=4000 where type='fighter'; -update ships set combat=500 where type='scow'; -update ships set speed=2000 where type='fighter' and speed < 2000; diff --git a/var/upgrades/2.4500.sql b/var/upgrades/2.4500.sql deleted file mode 100644 index 5494656c..00000000 --- a/var/upgrades/2.4500.sql +++ /dev/null @@ -1,5 +0,0 @@ -drop table saben_target; -alter table empire change essentia essentia float(11,1) not null default 0; -alter table essentia_code change amount amount float(11,1) not null default 0; -alter table market change ask ask float(11,1) not null default 1; -alter table essentia_log change amount amount float(11,1) not null default 0; diff --git a/var/upgrades/2.4501.sql b/var/upgrades/2.4501.sql deleted file mode 100644 index 911e1938..00000000 --- a/var/upgrades/2.4501.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table body change happiness happiness bigint not null default 0; -update ships set speed = 2500, hold_size = 100000 where speed = 100000 and hold_size = 85000 and stealth = 1000 and type = 'cargo_ship'; diff --git a/var/upgrades/3.000.sql b/var/upgrades/3.000.sql deleted file mode 100644 index a1aef4fc..00000000 --- a/var/upgrades/3.000.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table body add column alliance_id int; -alter table body add foreign key body_fk_alliance_id (alliance_id) references alliance (id) on delete set null; diff --git a/var/upgrades/3.0100.sql b/var/upgrades/3.0100.sql deleted file mode 100644 index 139d247d..00000000 --- a/var/upgrades/3.0100.sql +++ /dev/null @@ -1,99 +0,0 @@ -alter table body change happiness_hour happiness_hour bigint not null default 0; -alter table body change waste_hour waste_hour bigint not null default 0; -alter table body change waste_stored waste_stored bigint not null default 0; -alter table body change waste_capacity waste_capacity bigint not null default 0; -alter table body change energy_hour energy_hour bigint not null default 0; -alter table body change energy_stored energy_stored bigint not null default 0; -alter table body change energy_capacity energy_capacity bigint not null default 0; -alter table body change water_hour water_hour bigint not null default 0; -alter table body change water_stored water_stored bigint not null default 0; -alter table body change water_capacity water_capacity bigint not null default 0; -alter table body change ore_capacity ore_capacity bigint not null default 0; -alter table body change rutile_stored rutile_stored bigint not null default 0; -alter table body change chromite_stored chromite_stored bigint not null default 0; -alter table body change chalcopyrite_stored chalcopyrite_stored bigint not null default 0; -alter table body change galena_stored galena_stored bigint not null default 0; -alter table body change gold_stored gold_stored bigint not null default 0; -alter table body change uraninite_stored uraninite_stored bigint not null default 0; -alter table body change bauxite_stored bauxite_stored bigint not null default 0; -alter table body change goethite_stored goethite_stored bigint not null default 0; -alter table body change halite_stored halite_stored bigint not null default 0; -alter table body change gypsum_stored gypsum_stored bigint not null default 0; -alter table body change trona_stored trona_stored bigint not null default 0; -alter table body change kerogen_stored kerogen_stored bigint not null default 0; -alter table body change methane_stored methane_stored bigint not null default 0; -alter table body change anthracite_stored anthracite_stored bigint not null default 0; -alter table body change sulfur_stored sulfur_stored bigint not null default 0; -alter table body change zircon_stored zircon_stored bigint not null default 0; -alter table body change monazite_stored monazite_stored bigint not null default 0; -alter table body change fluorite_stored fluorite_stored bigint not null default 0; -alter table body change beryl_stored beryl_stored bigint not null default 0; -alter table body change magnetite_stored magnetite_stored bigint not null default 0; -alter table body change rutile_hour rutile_hour bigint not null default 0; -alter table body change chromite_hour chromite_hour bigint not null default 0; -alter table body change chalcopyrite_hour chalcopyrite_hour bigint not null default 0; -alter table body change galena_hour galena_hour bigint not null default 0; -alter table body change gold_hour gold_hour bigint not null default 0; -alter table body change uraninite_hour uraninite_hour bigint not null default 0; -alter table body change bauxite_hour bauxite_hour bigint not null default 0; -alter table body change goethite_hour goethite_hour bigint not null default 0; -alter table body change halite_hour halite_hour bigint not null default 0; -alter table body change gypsum_hour gypsum_hour bigint not null default 0; -alter table body change trona_hour trona_hour bigint not null default 0; -alter table body change kerogen_hour kerogen_hour bigint not null default 0; -alter table body change methane_hour methane_hour bigint not null default 0; -alter table body change anthracite_hour anthracite_hour bigint not null default 0; -alter table body change sulfur_hour sulfur_hour bigint not null default 0; -alter table body change zircon_hour zircon_hour bigint not null default 0; -alter table body change monazite_hour monazite_hour bigint not null default 0; -alter table body change fluorite_hour fluorite_hour bigint not null default 0; -alter table body change beryl_hour beryl_hour bigint not null default 0; -alter table body change magnetite_hour magnetite_hour bigint not null default 0; -alter table body change ore_hour ore_hour bigint not null default 0; -alter table body change food_capacity food_capacity bigint not null default 0; -alter table body change food_consumption_hour food_consumption_hour bigint not null default 0; -alter table body change lapis_production_hour lapis_production_hour bigint not null default 0; -alter table body change potato_production_hour potato_production_hour bigint not null default 0; -alter table body change apple_production_hour apple_production_hour bigint not null default 0; -alter table body change root_production_hour root_production_hour bigint not null default 0; -alter table body change corn_production_hour corn_production_hour bigint not null default 0; -alter table body change cider_production_hour cider_production_hour bigint not null default 0; -alter table body change wheat_production_hour wheat_production_hour bigint not null default 0; -alter table body change bread_production_hour bread_production_hour bigint not null default 0; -alter table body change soup_production_hour soup_production_hour bigint not null default 0; -alter table body change chip_production_hour chip_production_hour bigint not null default 0; -alter table body change pie_production_hour pie_production_hour bigint not null default 0; -alter table body change pancake_production_hour pancake_production_hour bigint not null default 0; -alter table body change milk_production_hour milk_production_hour bigint not null default 0; -alter table body change meal_production_hour meal_production_hour bigint not null default 0; -alter table body change algae_production_hour algae_production_hour bigint not null default 0; -alter table body change syrup_production_hour syrup_production_hour bigint not null default 0; -alter table body change fungus_production_hour fungus_production_hour bigint not null default 0; -alter table body change burger_production_hour burger_production_hour bigint not null default 0; -alter table body change shake_production_hour shake_production_hour bigint not null default 0; -alter table body change beetle_production_hour beetle_production_hour bigint not null default 0; -alter table body change bean_production_hour bean_production_hour bigint not null default 0; -alter table body change cheese_production_hour cheese_production_hour bigint not null default 0; -alter table body change cheese_stored cheese_stored bigint not null default 0; -alter table body change bean_stored bean_stored bigint not null default 0; -alter table body change lapis_stored lapis_stored bigint not null default 0; -alter table body change potato_stored potato_stored bigint not null default 0; -alter table body change apple_stored apple_stored bigint not null default 0; -alter table body change root_stored root_stored bigint not null default 0; -alter table body change corn_stored corn_stored bigint not null default 0; -alter table body change cider_stored cider_stored bigint not null default 0; -alter table body change wheat_stored wheat_stored bigint not null default 0; -alter table body change bread_stored bread_stored bigint not null default 0; -alter table body change soup_stored soup_stored bigint not null default 0; -alter table body change chip_stored chip_stored bigint not null default 0; -alter table body change pie_stored pie_stored bigint not null default 0; -alter table body change pancake_stored pancake_stored bigint not null default 0; -alter table body change milk_stored milk_stored bigint not null default 0; -alter table body change meal_stored meal_stored bigint not null default 0; -alter table body change algae_stored algae_stored bigint not null default 0; -alter table body change syrup_stored syrup_stored bigint not null default 0; -alter table body change fungus_stored fungus_stored bigint not null default 0; -alter table body change burger_stored burger_stored bigint not null default 0; -alter table body change shake_stored shake_stored bigint not null default 0; -alter table body change beetle_stored beetle_stored bigint not null default 0; - \ No newline at end of file diff --git a/var/upgrades/3.0200.sql b/var/upgrades/3.0200.sql deleted file mode 100644 index bf31012c..00000000 --- a/var/upgrades/3.0200.sql +++ /dev/null @@ -1,31 +0,0 @@ -CREATE TABLE `propositions` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(30) NOT NULL, - `station_id` int(11) NOT NULL, - `votes_needed` int(11) NOT NULL DEFAULT '1', - `votes_yes` int(11) NOT NULL DEFAULT '0', - `votes_no` int(11) NOT NULL DEFAULT '0', - `description` text, - `type` varchar(30) NOT NULL, - `scratch` mediumblob, - `date_ends` datetime NOT NULL, - `proposed_by_id` int(11) NOT NULL, - `status` varchar(10) NOT NULL DEFAULT 'Pending', - PRIMARY KEY (`id`), - KEY `propositions_idx_proposed_by_id` (`proposed_by_id`), - KEY `propositions_idx_station_id` (`station_id`), - KEY `idx_status_date_ends` (`status`,`date_ends`), - CONSTRAINT `propositions_fk_proposed_by_id` FOREIGN KEY (`proposed_by_id`) REFERENCES `empire` (`id`), - CONSTRAINT `propositions_fk_station_id` FOREIGN KEY (`station_id`) REFERENCES `body` (`id`) -); -CREATE TABLE `votes` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `proposition_id` int(11) NOT NULL, - `empire_id` int(11) NOT NULL, - `vote` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `votes_idx_empire_id` (`empire_id`), - KEY `votes_idx_proposition_id` (`proposition_id`), - CONSTRAINT `votes_fk_empire_id` FOREIGN KEY (`empire_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `votes_fk_proposition_id` FOREIGN KEY (`proposition_id`) REFERENCES `propositions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -); \ No newline at end of file diff --git a/var/upgrades/3.0300.sql b/var/upgrades/3.0300.sql deleted file mode 100644 index 0d466a6f..00000000 --- a/var/upgrades/3.0300.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table market add column has_spy tinyint default 0; - diff --git a/var/upgrades/3.0400.sql b/var/upgrades/3.0400.sql deleted file mode 100644 index 77f80f27..00000000 --- a/var/upgrades/3.0400.sql +++ /dev/null @@ -1,29 +0,0 @@ -CREATE TABLE `laws` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(30) NOT NULL, - `station_id` int(11) NOT NULL, - `description` text, - `type` varchar(30) NOT NULL, - `scratch` mediumblob, - `date_enacted` datetime NOT NULL, - `star_id` int(11) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `laws_idx_star_id` (`star_id`), - KEY `laws_idx_station_id` (`station_id`), - KEY `idx_date_enacted` (`date_enacted`), - CONSTRAINT `laws_fk_star_id` FOREIGN KEY (`star_id`) REFERENCES `star` (`id`) ON DELETE SET NULL, - CONSTRAINT `laws_fk_station_id` FOREIGN KEY (`station_id`) REFERENCES `body` (`id`) -); -alter table star add column station_id int; -alter table star add foreign key star_fk_alliance_id (station_id) references body (id) on delete set null; -alter table market drop column has_spy; -CREATE TABLE `mercenary_market` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `date_offered` datetime NOT NULL, - `body_id` int(11) NOT NULL, - `ship_id` int(11) NOT NULL, - `ask` float(11,1) NOT NULL, - `cost` float(11,1) NOT NULL, - `payload` mediumblob NOT NULL, - PRIMARY KEY (`id`) -); diff --git a/var/upgrades/3.0500.sql b/var/upgrades/3.0500.sql deleted file mode 100644 index db1c355c..00000000 --- a/var/upgrades/3.0500.sql +++ /dev/null @@ -1,19 +0,0 @@ -CREATE TABLE `taxes` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `empire_id` int(11) NOT NULL, - `station_id` int(11) NOT NULL, - `paid_6` int(11) NOT NULL DEFAULT 0, - `paid_5` int(11) NOT NULL DEFAULT 0, - `paid_4` int(11) NOT NULL DEFAULT 0, - `paid_3` int(11) NOT NULL DEFAULT 0, - `paid_2` int(11) NOT NULL DEFAULT 0, - `paid_1` int(11) NOT NULL DEFAULT 0, - `paid_0` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - KEY `taxes_idx_empire_id` (`empire_id`), - KEY `taxes_idx_station_id` (`station_id`), - CONSTRAINT `taxes_fk_empire_id` FOREIGN KEY (`empire_id`) REFERENCES `empire` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `taxes_fk_station_id` FOREIGN KEY (`station_id`) REFERENCES `body` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -); - - diff --git a/var/upgrades/3.0600.sql b/var/upgrades/3.0600.sql deleted file mode 100644 index 2193bc46..00000000 --- a/var/upgrades/3.0600.sql +++ /dev/null @@ -1,9 +0,0 @@ -alter table message add column has_trashed tinyint not null default 0; - -alter table empire add column `skip_found_nothing` tinyint NOT NULL default 0; -alter table empire add column `skip_excavator_resources` tinyint NOT NULL default 0; -alter table empire add column `skip_excavator_glyph` tinyint NOT NULL default 0; -alter table empire add column `skip_excavator_plan` tinyint NOT NULL default 0; -alter table empire add column `skip_spy_recovery` tinyint NOT NULL default 0; -alter table empire add column `skip_probe_detected` tinyint NOT NULL default 0; - diff --git a/var/upgrades/3.0601.sql b/var/upgrades/3.0601.sql deleted file mode 100644 index ada62cd8..00000000 --- a/var/upgrades/3.0601.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table ships add column fleet_speed int not null default 0; - diff --git a/var/upgrades/3.0602.sql b/var/upgrades/3.0602.sql deleted file mode 100644 index 9aac6196..00000000 --- a/var/upgrades/3.0602.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table empire_log change empire_size empire_size bigint not null; - diff --git a/var/upgrades/3.0700.sql b/var/upgrades/3.0700.sql deleted file mode 100644 index 3058e869..00000000 --- a/var/upgrades/3.0700.sql +++ /dev/null @@ -1,3 +0,0 @@ -alter table empire add column `rpc_boost` datetime NOT NULL default '2011-01-01 01:00:00'; - - diff --git a/var/upgrades/3.0800.sql b/var/upgrades/3.0800.sql deleted file mode 100644 index 58992573..00000000 --- a/var/upgrades/3.0800.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table empire drop column `rpc_boost`; - diff --git a/var/upgrades/3.0801.sql b/var/upgrades/3.0801.sql deleted file mode 100644 index ae3455ae..00000000 --- a/var/upgrades/3.0801.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table message add index idx_trash_only (has_trashed,to_id,date_sent); - diff --git a/var/upgrades/3.0811.sql b/var/upgrades/3.0811.sql deleted file mode 100644 index 6563aa25..00000000 --- a/var/upgrades/3.0811.sql +++ /dev/null @@ -1,19 +0,0 @@ -CREATE TABLE `battle_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `date_stamp` datetime NOT NULL, - `attacking_empire_id` int(11) NOT NULL, - `attacking_empire_name` char(30) NOT NULL, - `attacking_body_id` int(11) NOT NULL, - `attacking_body_name` char(30) NOT NULL, - `attacking_unit_name` char(60) NOT NULL, - `defending_empire_id` int(11) NOT NULL, - `defending_empire_name` char(30) NOT NULL, - `defending_body_id` int(11) NOT NULL, - `defending_body_name` char(30) NOT NULL, - `defending_unit_name` char(60) NOT NULL, - `victory_to` char(8) NOT NULL, - PRIMARY KEY (`id`) -); - -alter table empire add column `skip_attack_messages` tinyint NOT NULL default 0; - diff --git a/var/upgrades/3.0812.sql b/var/upgrades/3.0812.sql deleted file mode 100644 index 41496214..00000000 --- a/var/upgrades/3.0812.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table battle_log change column defending_empire_id defending_empire_id int(11); -alter table battle_log change column defending_empire_name defending_empire_name int(11); diff --git a/var/upgrades/3.0814.sql b/var/upgrades/3.0814.sql deleted file mode 100644 index 16289add..00000000 --- a/var/upgrades/3.0814.sql +++ /dev/null @@ -1,10 +0,0 @@ -alter table colony_log add column is_space_station int(11) not null default '0'; -alter table colony_log add column influence int(11) not null default '0'; - - - -alter table empire_log add column space_station_count int(11) not null default '0'; -alter table empire_log add column influence int(11) not null default '0'; - -alter table body add column surface_version int(11) not null default '0'; - diff --git a/var/upgrades/3.0817.sql b/var/upgrades/3.0817.sql deleted file mode 100644 index 184d374b..00000000 --- a/var/upgrades/3.0817.sql +++ /dev/null @@ -1,7 +0,0 @@ -alter table alliance_log add column population_rank int(11) not null default '0'; -alter table alliance_log add column space_station_count_rank int(11) not null default '0'; -alter table alliance_log add column influence_rank int(11) not null default '0'; -alter table alliance_log add index idx_population_rank (population_rank); -alter table alliance_log add index idx_space_station_count_rank (space_station_count_rank); -alter table alliance_log add index idx_influence_rank (influence_rank); -alter table empire add column building_boost datetime NOT NULL default '2011-01-01 01:00:00'; diff --git a/var/upgrades/3.0820wq.sql b/var/upgrades/3.0820wq.sql deleted file mode 100644 index 99834503..00000000 --- a/var/upgrades/3.0820wq.sql +++ /dev/null @@ -1,17 +0,0 @@ -alter table battle_log add column attacked_body_id int not null; -alter table battle_log add column attacked_body_name varchar(30) not null; -alter table battle_log add column attacked_empire_id int default null; -alter table battle_log add column attacked_empire_name varchar(30) default null; -alter table battle_log modify defending_empire_name char(30); - -create table ai_scratch_pad ( - id int(11) not null auto_increment, - ai_empire_id int(11) not null, - body_id int(11) not null, - pad mediumblob, - primary key (id), - key aic_idx_ai_empire_id (ai_empire_id), - key aic_idx_body_id (body_id), - constraint aic_fk_empire_id foreign key (ai_empire_id) references empire (id) -); - diff --git a/var/upgrades/3.0821.sql b/var/upgrades/3.0821.sql deleted file mode 100644 index f429e5db..00000000 --- a/var/upgrades/3.0821.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table battle_log add column attacking_type varchar(30) not null; -alter table battle_log add column defending_type varchar(30) not null; diff --git a/var/upgrades/3.0822.sql b/var/upgrades/3.0822.sql deleted file mode 100644 index b2841f9a..00000000 --- a/var/upgrades/3.0822.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE ai_battle_summary ( - id int(11) NOT NULL AUTO_INCREMENT, - attacking_empire_id int(11) NOT NULL, - defending_empire_id int(11) NOT NULL, - attack_victories int(11) NOT NULL, - defense_victories int(11) NOT NULL, - PRIMARY KEY (id) -); - - diff --git a/var/upgrades/3.0827.sql b/var/upgrades/3.0827.sql deleted file mode 100644 index c4c2e6e9..00000000 --- a/var/upgrades/3.0827.sql +++ /dev/null @@ -1 +0,0 @@ -alter table ai_battle_summary add column attack_spy_hours int(11) not null default 0; diff --git a/var/upgrades/3.0831.sql b/var/upgrades/3.0831.sql deleted file mode 100644 index 6887ae27..00000000 --- a/var/upgrades/3.0831.sql +++ /dev/null @@ -1,4 +0,0 @@ -alter table colony_log add column body_id int(11) not null default 0; -alter table colony_log add column x int(11) not null default 0; -alter table colony_log add column y int(11) not null default 0; -alter table colony_log add column zone varchar(16) not null default 0; diff --git a/var/upgrades/3.0836.sql b/var/upgrades/3.0836.sql deleted file mode 100644 index 93a1de59..00000000 --- a/var/upgrades/3.0836.sql +++ /dev/null @@ -1,9 +0,0 @@ -alter table market add column speed int(11) not null default 0; -alter table market add column x int(11) not null default 0; -alter table market add column y int(11) not null default 0; -alter table market add column trade_range int(11) not null default 0; - -update market set transfer_type='trade' where transfer_type != 'transporter'; -update market,body set market.x = body.x, market.y = body.y where market.body_id=body.id; -update market,ships set market.speed = ships.speed where market.ship_id=ships.id; -update market set trade_range=500 where transfer_type='trade'; diff --git a/var/upgrades/3.0838.sql b/var/upgrades/3.0838.sql deleted file mode 100644 index 14a22d4a..00000000 --- a/var/upgrades/3.0838.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE `excavators` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `planet_id` int(11) NOT NULL, - `body_id` int(11) NOT NULL, - `empire_id` int(11) NOT NULL, - PRIMARY KEY (`id`) -); -alter table empire add column `skip_excavator_artifact` tinyint NOT NULL default 0; -alter table empire add column `skip_excavator_destroyed` tinyint NOT NULL default 0; -alter table building add column `last_check` datetime NOT NULL default '2012-03-23 23:00:00'; diff --git a/var/upgrades/3.0843.sql b/var/upgrades/3.0843.sql deleted file mode 100644 index bbc2b512..00000000 --- a/var/upgrades/3.0843.sql +++ /dev/null @@ -1,3 +0,0 @@ -alter table essentia_code add column `empire_id` int default 0; -alter table essentia_log add column `from_id` int default 0; -alter table essentia_log add column `from_name` varchar(30) default ""; diff --git a/var/upgrades/3.0845.sql b/var/upgrades/3.0845.sql deleted file mode 100644 index ddeddd28..00000000 --- a/var/upgrades/3.0845.sql +++ /dev/null @@ -1 +0,0 @@ -delete from ships where type = 'excavator'; diff --git a/var/upgrades/3.0847.sql b/var/upgrades/3.0847.sql deleted file mode 100644 index e853cba1..00000000 --- a/var/upgrades/3.0847.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table ships add column berth_level tinyint default 1; -delete from probes where empire_id < 0; diff --git a/var/upgrades/3.0848.sql b/var/upgrades/3.0848.sql deleted file mode 100644 index 465ca226..00000000 --- a/var/upgrades/3.0848.sql +++ /dev/null @@ -1 +0,0 @@ -delete excavators, body from excavators INNER JOIN body on body.id = excavators.planet_id where excavators.empire_id != body.empire_id; diff --git a/var/upgrades/3.0849.sql b/var/upgrades/3.0849.sql deleted file mode 100644 index d97c9432..00000000 --- a/var/upgrades/3.0849.sql +++ /dev/null @@ -1,14 +0,0 @@ - -create table waste_chain ( - id int(11) not null auto_increment, - planet_id int(11) not null, - star_id int(11) not null, - waste_hour int(11) not null default 0, - percent_transferred int(11) not null default 0, - primary key (id), - key wc_idx_planet_id (planet_id), - key wc_idx_star_id (star_id), - constraint wc_fk_planet_id foreign key (planet_id) references body (id), - constraint wc_fk_star_id foreign key (star_id) references star (id) -); - diff --git a/var/upgrades/3.0851.sql b/var/upgrades/3.0851.sql deleted file mode 100644 index 5df72147..00000000 --- a/var/upgrades/3.0851.sql +++ /dev/null @@ -1,22 +0,0 @@ - -update ships set speed = 700 where type = 'short_range_colony_ship'; - -create table supply_chain ( - id int(11) not null auto_increment, - planet_id int(11) not null, - building_id int(11) not null, - target_id int(11) not null, - resource_hour bigint not null default 0, - resource_type varchar(32) not null, - percent_transferred int(11) not null default 0, - stalled int(11) not null default 0, - primary key (id), - key rc_idx_planet_id (planet_id), - key rc_idx_building_id (building_id), - key rc_idx_target_id (target_id) -); - -alter table waste_chain modify waste_hour bigint; - -update waste_chain,body set waste_chain.star_id=body.star_id where waste_chain.planet_id=body.id; - diff --git a/var/upgrades/3.0852.sql b/var/upgrades/3.0852.sql deleted file mode 100644 index 790be601..00000000 --- a/var/upgrades/3.0852.sql +++ /dev/null @@ -1,5 +0,0 @@ -alter table body add column max_berth tinyint default 1; -alter table empire add column has_new_messages integer(11) not null default 0; -alter table empire add column skip_incoming_ships tinyint(4) not null default 0; -alter table empire add column latest_message_id integer(11); - diff --git a/var/upgrades/3.0853.sql b/var/upgrades/3.0853.sql deleted file mode 100644 index ee2e16d4..00000000 --- a/var/upgrades/3.0853.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table empire add column `dont_replace_excavator` tinyint NOT NULL default 0; -alter table empire add column `skip_excavator_replace_msg` tinyint NOT NULL default 0; diff --git a/var/upgrades/3.0854.sql b/var/upgrades/3.0854.sql deleted file mode 100644 index 36918486..00000000 --- a/var/upgrades/3.0854.sql +++ /dev/null @@ -1,33 +0,0 @@ - -create table fleet ( - id int(11) not null auto_increment, - body_id int(11) not null, - shipyard_id int(11) not null, - date_started datetime not null, - date_available datetime not null, - mark varchar(10) not null, - type varchar(30) not null, - task varchar(30) not null, - name varchar(30) not null, - speed int(11) not null, - stealth int(11) not null, - combat int(11) not null, - hold_size int(11) not null, - payload mediumblob, - roundtrip tinyint(4) not null default 0, - direction varchar(3) not null, - foreign_body_id int(11), - foreign_star_id int(11), - berth_level tinyint(4) default 1, - primary key (id), - key f_mark (mark), - key f_idx_body_id (body_id), - key f_idx_foreign_body_id (foreign_body_id), - key f_idx_foreign_star_id (foreign_star_id), - constraint wc_f_body_id foreign key (body_id) references body (id), - constraint wc_f_foreign_body_id foreign key (foreign_body_id) references body (id), - constraint wc_f_foreign_star_id foreign key (foreign_star_id) references star (id) -); - -delete building from body,building where building.body_id=body.id and building.class not like "%Perm%" and body.empire_id is null; - diff --git a/var/upgrades/3.0856.sql b/var/upgrades/3.0856.sql deleted file mode 100644 index ffbbb80a..00000000 --- a/var/upgrades/3.0856.sql +++ /dev/null @@ -1,3 +0,0 @@ - -delete from mission; - diff --git a/var/upgrades/3.0857.sql b/var/upgrades/3.0857.sql deleted file mode 100644 index 99fbd50e..00000000 --- a/var/upgrades/3.0857.sql +++ /dev/null @@ -1 +0,0 @@ -alter table alliance_log change population population bigint not null; diff --git a/var/upgrades/3.0859.sql b/var/upgrades/3.0859.sql deleted file mode 100644 index 9ae73b0b..00000000 --- a/var/upgrades/3.0859.sql +++ /dev/null @@ -1,26 +0,0 @@ - -CREATE TABLE glyph ( - id INT(11) NOT NULL AUTO_INCREMENT, - body_id INT(11) NOT NULL, - type VARCHAR(20) NOT NULL, - quantity INT(11) NOT NULL DEFAULT 0, - PRIMARY KEY (id), - KEY glyph_idx_body_id (body_id), - CONSTRAINT glyph_fc_body_id FOREIGN KEY (body_id) REFERENCES body (id) -); - -INSERT INTO glyph (body_id, TYPE, quantity) SELECT body_id,TYPE,COUNT(id) FROM glyphs GROUP BY body_id,TYPE; -CREATE TABLE plan ( - id INT(11) NOT NULL AUTO_INCREMENT, - body_id INT(11) NOT NULL, - class VARCHAR(255) NOT NULL, - level tinyint not NULL, - extra_build_level tinyint not NULL, - quantity INT(11) NOT NULL DEFAULT 0, - PRIMARY KEY (id), - KEY plan_idx_body_id (body_id), - CONSTRAINT plan_fc_body_id FOREIGN KEY (body_id) REFERENCES body (id) -); - -INSERT INTO plan (body_id,class,level,extra_build_level,quantity) SELECT body_id,class,level,extra_build_level,count(id) from plans group by body_id,class,level,extra_build_level; - diff --git a/var/upgrades/3.0860.sql b/var/upgrades/3.0860.sql deleted file mode 100644 index 559d044e..00000000 --- a/var/upgrades/3.0860.sql +++ /dev/null @@ -1,11 +0,0 @@ -create table empire_rpc_log ( - id int(11) not null auto_increment, - date_stamp datetime not null, - empire_id int(11) not null, - empire_name varchar(30) not null, - rpc int(11) not null default 0, - limits int(11) not null default 0, - primary key (id), - key erl_idx_empire_id (empire_id), - key erl_idx_date_stamp (date_stamp) -); diff --git a/var/upgrades/3.0861.sql b/var/upgrades/3.0861.sql deleted file mode 100644 index 69cb5ec3..00000000 --- a/var/upgrades/3.0861.sql +++ /dev/null @@ -1 +0,0 @@ -alter table body add column ore_consumption_hour bigint not null default 0; diff --git a/var/upgrades/3.0866.sql b/var/upgrades/3.0866.sql deleted file mode 100644 index 9cd8cd52..00000000 --- a/var/upgrades/3.0866.sql +++ /dev/null @@ -1,7 +0,0 @@ -create table config ( - id int(11) not null auto_increment, - name varchar(30) not null, - value varchar(256), - primary key (id), - key c_idx_key (name) -); diff --git a/var/upgrades/3.0872.sql b/var/upgrades/3.0872.sql deleted file mode 100644 index 7e846b13..00000000 --- a/var/upgrades/3.0872.sql +++ /dev/null @@ -1,2 +0,0 @@ -create table spies_bak like spies; -insert into spies_bak select from spies; diff --git a/var/upgrades/3.0873.sql b/var/upgrades/3.0873.sql deleted file mode 100644 index 8237e915..00000000 --- a/var/upgrades/3.0873.sql +++ /dev/null @@ -1,3 +0,0 @@ -alter table body add column `unhappy_date` datetime NOT NULL default '2012-11-10 04:00:00'; -alter table body add column `unhappy` tinyint(4) NOT NULL default 0; -alter table spies add column `next_task` varchar(30) NOT NULL default 'Idle'; diff --git a/var/upgrades/3.0875.sql b/var/upgrades/3.0875.sql deleted file mode 100644 index 592917f3..00000000 --- a/var/upgrades/3.0875.sql +++ /dev/null @@ -1,14 +0,0 @@ - -create table schedule ( - id int(11) not null auto_increment, - queue varchar(30) not null, - job_id int(11) not null default 0, - delivery datetime not null, - priority int(11) not null default 0, - parent_table varchar(30) not null, - parent_id int(11) not null, - task varchar(30) not null, - args mediumblob, - primary key (id) -); - diff --git a/var/upgrades/3.0879.sql b/var/upgrades/3.0879.sql deleted file mode 100644 index 80c84bc9..00000000 --- a/var/upgrades/3.0879.sql +++ /dev/null @@ -1,18 +0,0 @@ -alter table empire add column essentia_free float(11,1) not null default 0 after essentia; -alter table empire add column essentia_game float(11,1) not null default 0 after essentia; -alter table empire add column essentia_paid float(11,1) not null default 0 after essentia; - -update empire set essentia_game=essentia; - -alter table login_log add column is_sitter int(1) not null default 0; - -create table empire_name_change_log ( - id int(11) not null auto_increment, - date_stamp datetime not null, - empire_id int(11) not null, - empire_name varchar(30) not null, - old_empire_name varchar(30) not null, - primary key (id), - key erl_idx_empire_id (empire_id), - key erl_idx_date_stamp (date_stamp) -); diff --git a/var/upgrades/3.0887.sql b/var/upgrades/3.0887.sql deleted file mode 100644 index 0de70ad1..00000000 --- a/var/upgrades/3.0887.sql +++ /dev/null @@ -1,4 +0,0 @@ - -alter table alliance add column image varchar(255) default 'default'; - - diff --git a/var/upgrades/3.0888.sql b/var/upgrades/3.0888.sql deleted file mode 100644 index 5809311c..00000000 --- a/var/upgrades/3.0888.sql +++ /dev/null @@ -1,4 +0,0 @@ - -alter table probes add column virtual int default 0; - - diff --git a/var/upgrades/3.0895.sql b/var/upgrades/3.0895.sql deleted file mode 100644 index c1131bc9..00000000 --- a/var/upgrades/3.0895.sql +++ /dev/null @@ -1,2 +0,0 @@ - -alter table excavators add column `date_landed` datetime NOT NULL default '2013-11-09 07:05:03'; diff --git a/var/upgrades/3.0896.sql b/var/upgrades/3.0896.sql deleted file mode 100644 index 99088855..00000000 --- a/var/upgrades/3.0896.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table empire add column spy_training_boost datetime NOT NULL default '2013-12-25 23:00:00'; -alter table body add column `spy_happy_boost` int(11) NOT NULL default 0; diff --git a/var/upgrades/3.0900.sql b/var/upgrades/3.0900.sql deleted file mode 100644 index 20fee004..00000000 --- a/var/upgrades/3.0900.sql +++ /dev/null @@ -1 +0,0 @@ -alter table body change spy_happy_boost propaganda_boost int(11) NOT NULL default 0; diff --git a/var/upgrades/3.0907.sql b/var/upgrades/3.0907.sql deleted file mode 100644 index 978a5cc8..00000000 --- a/var/upgrades/3.0907.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table body add column `neutral_entry` datetime NOT NULL default '2014-11-10 12:00:00'; - diff --git a/var/upgrades/3.0909.sql b/var/upgrades/3.0909.sql deleted file mode 100644 index bbc2cac1..00000000 --- a/var/upgrades/3.0909.sql +++ /dev/null @@ -1,21 +0,0 @@ -alter table ships add column number_of_docks int default 1; -alter table ships modify hold_size bigint; -alter table battle_log add column attacking_number int default 1; -alter table battle_log add column defending_number int default 1; -alter table empire add column in_stasis tinyint default 0; -alter table empire add column timeout tinyint default 0; -alter table empire add column outlaw tinyint default 0; -alter table empire add column outlaw_date datetime default '2010-10-03 18:17:26'; -alter table essentia_log modify transaction_id varchar(36); - -CREATE TABLE empire_admin_notes ( - id integer(11) NOT NULL auto_increment, - date_stamp datetime NOT NULL, - empire_id integer(11) NOT NULL, - empire_name varchar(30) NOT NULL, - notes text NOT NULL, - creator varchar(30) NOT NULL, - INDEX idx_empire_id (empire_id), - INDEX idx_empire_name (empire_name), - PRIMARY KEY (id) -); diff --git a/var/upgrades/3.0910.sql b/var/upgrades/3.0910.sql deleted file mode 100644 index a5792140..00000000 --- a/var/upgrades/3.0910.sql +++ /dev/null @@ -1,34 +0,0 @@ -alter table star add column needs_recalc tinyint not null default 0; -alter table star add column influence int not null default 0; -alter table star add index idx_recalc (needs_recalc); - -delete from laws where type = 'Jurisdiction'; - -CREATE TABLE stationinfluence ( - id integer(11) NOT NULL auto_increment, - station_id integer NOT NULL, - star_id integer NOT NULL, - alliance_id integer NOT NULL, - oldinfluence integer NOT NULL, - oldstart datetime NULL, - influence integer NOT NULL, - started_influence datetime NOT NULL, - INDEX stationinfluence_idx_alliance_id (alliance_id), - INDEX stationinfluence_idx_star_id (star_id), - INDEX stationinfluence_idx_station_id (station_id), - PRIMARY KEY (id), - CONSTRAINT stationinfluence_fk_alliance_id FOREIGN KEY (alliance_id) REFERENCES alliance (id), - CONSTRAINT stationinfluence_fk_star_id FOREIGN KEY (star_id) REFERENCES star (id), - CONSTRAINT stationinfluence_fk_station_id FOREIGN KEY (station_id) REFERENCES body (id) ON DELETE CASCADE -); - -DELIMITER // - -CREATE TRIGGER stationinfluence_cleanup after delete ON stationinfluence - FOR EACH ROW BEGIN - UPDATE star s SET s.needs_recalc = 1 WHERE s.id = OLD.star_id; -END // - -DELIMITER ; - --- after this is done, run bin/initial_jurisdiction.pl diff --git a/var/upgrades/3.0912.sql b/var/upgrades/3.0912.sql deleted file mode 100644 index 8580703a..00000000 --- a/var/upgrades/3.0912.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table body add column notes text; -alter table propositions drop column votes_yes, drop column votes_no, drop column votes_needed; diff --git a/var/upgrades/3.0914.sql b/var/upgrades/3.0914.sql deleted file mode 100644 index e9398ec3..00000000 --- a/var/upgrades/3.0914.sql +++ /dev/null @@ -1 +0,0 @@ -alter table market add column max_university int; diff --git a/var/upgrades/3.0915.sql b/var/upgrades/3.0915.sql deleted file mode 100644 index a2317ed3..00000000 --- a/var/upgrades/3.0915.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE promotion ( - id integer(11) NOT NULL auto_increment, - start_date datetime NOT NULL, - end_date datetime NOT NULL, - type varchar(30) NOT NULL, - min_purchase integer NULL, - max_purchase integer NULL, - payload mediumblob NULL, - PRIMARY KEY (id) -); - -alter table empire drop column has_new_messages; -alter table login_log add column browser_fingerprint varchar(32) NULL; -alter table login_log add index idx_fingerprint (browser_fingerprint); diff --git a/var/upgrades/3.0917.sql b/var/upgrades/3.0917.sql deleted file mode 100644 index d92ca3bf..00000000 --- a/var/upgrades/3.0917.sql +++ /dev/null @@ -1,14 +0,0 @@ --- Table: sitter_auths --- -CREATE TABLE sitter_auths ( - baby_id integer NOT NULL, - sitter_id integer NOT NULL, - expiry datetime NOT NULL, - INDEX sitter_auths_idx_baby_id (baby_id), - INDEX sitter_auths_idx_sitter_id (sitter_id), - PRIMARY KEY (baby_id, sitter_id), - CONSTRAINT sitter_auths_fk_baby_id FOREIGN KEY (baby_id) REFERENCES empire (id) ON DELETE CASCADE, - CONSTRAINT sitter_auths_fk_sitter_id FOREIGN KEY (sitter_id) REFERENCES empire (id) ON DELETE CASCADE -) ENGINE=InnoDB;-- - -alter table message modify subject varchar(64); diff --git a/var/upgrades/3.0918.sql b/var/upgrades/3.0918.sql deleted file mode 100644 index 0864d1f2..00000000 --- a/var/upgrades/3.0918.sql +++ /dev/null @@ -1,15 +0,0 @@ -# tidy up of some unused tables - -drop table glyphs; -drop table body_old; -drop table propositions_bak; -drop table temp; -drop table trades; -drop table votes_bak; -delete from cargo_log; -create table lottery_log_bu select * from lottery_log; -delete from lottery_log where date_stamp < "2015-01-01 00:00:00"; -create table login_log_bu select * from login_log; -delete from login_log where date_stamp < "2015-01-01 00:00:00"; -create table news_bu select * from news; -delete from news where date_posted < "2015-01-01 00:00:00"; diff --git a/var/upgrades/3.0919.sql b/var/upgrades/3.0919.sql deleted file mode 100644 index 94bcd880..00000000 --- a/var/upgrades/3.0919.sql +++ /dev/null @@ -1,5 +0,0 @@ -# - -alter table captcha add column created TIMESTAMP DEFAULT CURRENT_TIMESTAMP; - - diff --git a/var/upgrades/3.0923.sql b/var/upgrades/3.0923.sql deleted file mode 100644 index 96ebd8dd..00000000 --- a/var/upgrades/3.0923.sql +++ /dev/null @@ -1,8 +0,0 @@ -create table survey ( - empire_id int(11) not null, - choice int(11) not null default 0, - comment text not null default '', - primary key (empire_id), - constraint survey_fk_empire_id foreign key (empire_id) references empire (id) -); - diff --git a/var/upgrades/4.0000.sql b/var/upgrades/4.0000.sql deleted file mode 100644 index 79526bdc..00000000 --- a/var/upgrades/4.0000.sql +++ /dev/null @@ -1,45 +0,0 @@ - -create table fleet ( - id int(11) not null auto_increment, - body_id int(11) not null, - shipyard_id int(11) not null, - date_started datetime not null, - date_available datetime not null, - mark varchar(10) not null, - type varchar(30) not null, - task varchar(30) not null, - name varchar(30) not null, - speed int(11) not null, - stealth int(11) not null, - combat int(11) not null, - hold_size int(11) not null, - payload mediumblob, - roundtrip tinyint(4) not null default 0, - direction varchar(3) not null, - foreign_body_id int(11), - foreign_star_id int(11), - berth_level tinyint(4) default 1, - quantity int(11) not null default 1, - primary key (id), - key f_mark (mark), - key f_idx_body_id (body_id), - key f_idx_foreign_body_id (foreign_body_id), - key f_idx_foreign_star_id (foreign_star_id), - constraint wc_f_body_id foreign key (body_id) references body (id), - constraint wc_f_foreign_body_id foreign key (foreign_body_id) references body (id), - constraint wc_f_foreign_star_id foreign key (foreign_star_id) references star (id) -); - -create table schedule ( - id int(11) not null auto_increment, - queue varchar(30) not null, - job_id int(11) not null default 0, - delivery datetime not null, - priority int(11) not null default 0, - parent_table varchar(30) not null, - parent_id int(11) not null, - task varchar(30) not null, - args mediumblob, - primary key (id) -); - diff --git a/var/upgrades/4.0001.sql b/var/upgrades/4.0001.sql deleted file mode 100644 index 89b0e5bb..00000000 --- a/var/upgrades/4.0001.sql +++ /dev/null @@ -1,2 +0,0 @@ - -alter table captcha add column `created` datetime NOT NULL default 0; diff --git a/var/upgrades/4.0002.sql b/var/upgrades/4.0002.sql deleted file mode 100644 index 80ba34bf..00000000 --- a/var/upgrades/4.0002.sql +++ /dev/null @@ -1,25 +0,0 @@ --- Two AI bookkeeping tables shipped from Result classes that were missing --- `is_auto_increment => 1` on their `id` column and never called set_primary_key, --- so DBIx::Class inserted id=0 for the first row and every later insert died with --- "Duplicate entry '0' for key 'PRIMARY'". For ai_battle_summary that killed the --- battle-log summary hook, which killed the ship-arrival job, leaving any ship --- that triggered combat on arrival stuck in task='Travelling' forever. For --- ai_scratch_pad it blocked the DeLambert AI from ever bootstrapping. --- --- The Result classes are now fixed; this brings existing databases into line. --- (The PRIMARY KEY on `id` already exists on deployed schemas.) - -DELETE FROM ai_battle_summary WHERE id = 0; -ALTER TABLE ai_battle_summary MODIFY COLUMN id int(11) NOT NULL AUTO_INCREMENT; - -DELETE FROM ai_scratch_pad WHERE id = 0; -ALTER TABLE ai_scratch_pad MODIFY COLUMN id int(11) NOT NULL AUTO_INCREMENT; - --- The whole codebase (Lacuna::AI::scratch, bin//add_colonies.pl, --- Lacuna::Web::Admin) uses body_id = 0 as the "whole empire" scratch-pad --- sentinel, but body id 0 does not exist, so this foreign key can never be --- satisfied for the empire-wide pad. Drop it. (Named ai_scratch_pad_fk_body_id --- in the shipped schema; if your database does not have it, this line is a --- harmless no-op error.) The plain KEY ai_scratch_pad_idx_body_id is left in --- place for lookup performance. -ALTER TABLE ai_scratch_pad DROP FOREIGN KEY ai_scratch_pad_fk_body_id; diff --git a/var/upgrades/4.0003.sql b/var/upgrades/4.0003.sql deleted file mode 100644 index d1cc421a..00000000 --- a/var/upgrades/4.0003.sql +++ /dev/null @@ -1,12 +0,0 @@ --- Remove dead third-party integration columns from `empire`. --- --- `facebook_uid` / `facebook_token` / `skip_facebook_wall_posts` supported the --- Facebook::Graph login + wall-post integration (lib/Lacuna/Web/Facebook.pm), --- now removed. `chat_admin` was read only by the Firebase/ChiselChat external --- chat (lib/Lacuna/RPC/Chat.pm, lib/Lacuna/Web/Chat.pm), also removed. Nothing --- in the codebase references any of these columns any more. - -ALTER TABLE empire DROP COLUMN facebook_uid; -ALTER TABLE empire DROP COLUMN facebook_token; -ALTER TABLE empire DROP COLUMN skip_facebook_wall_posts; -ALTER TABLE empire DROP COLUMN chat_admin; diff --git a/var/upgrades/4.0004.sql b/var/upgrades/4.0004.sql deleted file mode 100644 index a8a56cf5..00000000 --- a/var/upgrades/4.0004.sql +++ /dev/null @@ -1,9 +0,0 @@ --- Remove browser fingerprinting from login tracking. --- --- `login_log.browser_fingerprint` stored a client-supplied browser fingerprint --- captured on every login (login RPC's 5th param -> Lacuna::Session::start -> --- login_log). It was only ever used by the admin login-log search to correlate --- accounts by device. Nothing in the codebase references it any more. - -ALTER TABLE login_log DROP INDEX idx_fingerprint; -ALTER TABLE login_log DROP COLUMN browser_fingerprint; diff --git a/var/upgrades/add_missions.sql b/var/upgrades/add_missions.sql deleted file mode 100644 index 260b92e3..00000000 --- a/var/upgrades/add_missions.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE `mission` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `mission_file_name` varchar(100) NOT NULL, - `zone` varchar(16) NOT NULL, - `date_posted` datetime NOT NULL, - `max_university_level` tinyint NOT NULL, - PRIMARY KEY (`id`), - KEY `idx_zone_date_posted` (`zone`,`date_posted`) -); \ No newline at end of file diff --git a/var/upgrades/upgrade.add_logs.sql b/var/upgrades/upgrade.add_logs.sql deleted file mode 100644 index 380e1a62..00000000 --- a/var/upgrades/upgrade.add_logs.sql +++ /dev/null @@ -1,107 +0,0 @@ -alter table spies add column `date_created` datetime NOT NULL; -alter table spies add column `mission_count` int(11) NOT NULL DEFAULT '0'; -alter table spies add column `mission_successes` int(11) NOT NULL DEFAULT '0'; -alter table spies add column `times_captured` int(11) NOT NULL DEFAULT '0'; -alter table spies add column `times_turned` int(11) NOT NULL DEFAULT '0'; -alter table spies add column `seeds_planted` int(11) NOT NULL DEFAULT '0'; -alter table spies add column `spies_killed` int(11) NOT NULL DEFAULT '0'; -alter table spies add column `spies_captured` int(11) NOT NULL DEFAULT '0'; -alter table spies add column `spies_turned` int(11) NOT NULL DEFAULT '0'; -alter table spies add column `things_destroyed` int(11) NOT NULL DEFAULT '0'; -alter table spies add column `things_stolen` int(11) NOT NULL DEFAULT '0'; - - -CREATE TABLE `colony_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `date_stamp` datetime NOT NULL, - `empire_id` int(11) NOT NULL, - `empire_name` char(30) NOT NULL, - `planet_id` int(11) NOT NULL, - `planet_name` char(30) NOT NULL, - `population` int(11) NOT NULL, - `building_count` int(3) NOT NULL, - `average_building_level` float(3,2) NOT NULL, - `highest_building_level` int(3) NOT NULL, - `lowest_building_level` int(3) NOT NULL, - `food_hour` int(11) NOT NULL, - `energy_hour` int(11) NOT NULL, - `waste_hour` int(11) NOT NULL, - `ore_hour` int(11) NOT NULL, - `water_hour` int(11) NOT NULL, - PRIMARY KEY (`id`) -); -CREATE TABLE `empire_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `date_stamp` datetime NOT NULL, - `empire_id` int(11) NOT NULL, - `empire_name` char(30) NOT NULL, - `colony_count` int(3) NOT NULL, - `population` int(11) NOT NULL, - `building_count` int(3) NOT NULL, - `university_level` int(3) NOT NULL, - `average_building_level` float(3,2) NOT NULL, - `highest_building_level` int(3) NOT NULL, - `lowest_building_level` int(3) NOT NULL, - `food_hour` int(11) NOT NULL, - `energy_hour` int(11) NOT NULL, - `waste_hour` int(11) NOT NULL, - `ore_hour` int(11) NOT NULL, - `water_hour` int(11) NOT NULL, - `spy_count` int(11) NOT NULL, - `avg_spy_success_rate` int(11) NOT NULL, - PRIMARY KEY (`id`) -); -CREATE TABLE `espionage_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `date_stamp` datetime NOT NULL, - `empire_id` int(11) NOT NULL, - `empire_name` char(30) NOT NULL, - `amount` int(11) NOT NULL, - `description` char(90) NOT NULL, - PRIMARY KEY (`id`) -); -CREATE TABLE `essentia_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `date_stamp` datetime NOT NULL, - `empire_id` int(11) NOT NULL, - `empire_name` char(30) NOT NULL, - `api_key` char(40) DEFAULT NULL, - `amount` int(11) NOT NULL, - `description` char(90) NOT NULL, - PRIMARY KEY (`id`) -); -CREATE TABLE `login_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `date_stamp` datetime NOT NULL, - `empire_id` int(11) NOT NULL, - `empire_name` char(30) NOT NULL, - `api_key` char(40) DEFAULT NULL, - `session_id` char(40) NOT NULL, - `log_out_date` datetime DEFAULT NULL, - `extended` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -); -CREATE TABLE `spy_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `date_stamp` datetime NOT NULL, - `empire_id` int(11) NOT NULL, - `empire_name` char(30) NOT NULL, - `spy_name` char(30) NOT NULL, - `spy_id` int(11) NOT NULL, - `level` int(11) NOT NULL, - `level_delta` int(11) NOT NULL DEFAULT '0', - `success_rate` float(11,2) NOT NULL, - `success_rate_delta` float(11,2) NOT NULL DEFAULT '0.00', - `age` int(11) NOT NULL, - `times_captured` int(11) NOT NULL DEFAULT '0', - `times_turned` int(11) NOT NULL DEFAULT '0', - `seeds_planted` int(11) NOT NULL DEFAULT '0', - `spies_killed` int(11) NOT NULL DEFAULT '0', - `spies_captured` int(11) NOT NULL DEFAULT '0', - `spies_turned` int(11) NOT NULL DEFAULT '0', - `things_destroyed` int(11) NOT NULL DEFAULT '0', - `things_stolen` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `spy_log_idx_spy_id` (`spy_id`), - CONSTRAINT `spy_log_fk_spy_id` FOREIGN KEY (`spy_id`) REFERENCES `spies` (`id`) -);