From d480fc3ba0d92ed7c67765c67697c680e927fcfe Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Sat, 7 Dec 2024 02:54:43 -0800 Subject: [PATCH] merge to 1 sql file for sqlite database --- migrations/dlu/0_initial.sql | 40 ++++++++++++++++++- migrations/dlu/10_Security_updates.sql | 8 ---- .../dlu/11_fix_cheat_detection_table.sql | 9 ----- migrations/dlu/12_modular_build_ugc.sql | 5 --- migrations/dlu/13_ignore_list.sql | 6 --- migrations/dlu/14_reward_codes.sql | 5 --- migrations/dlu/15_behavior_owner.sql | 0 migrations/dlu/16_big_behaviors.sql | 0 migrations/dlu/1_unique_charinfo_names.sql | 0 migrations/dlu/2_reporter_id.sql | 1 - migrations/dlu/3_add_performance_cost.sql | 1 - migrations/dlu/4_friends_list_objectids.sql | 1 - migrations/dlu/5_brick_model_sd0.sql | 1 - migrations/dlu/6_property_behaviors.sql | 2 - .../dlu/7_make_play_key_id_nullable.sql | 0 migrations/dlu/8_foreign_play_key.sql | 0 .../dlu/9_Update_Leaderboard_Storage.sql | 0 17 files changed, 38 insertions(+), 41 deletions(-) delete mode 100644 migrations/dlu/10_Security_updates.sql delete mode 100644 migrations/dlu/11_fix_cheat_detection_table.sql delete mode 100644 migrations/dlu/12_modular_build_ugc.sql delete mode 100644 migrations/dlu/13_ignore_list.sql delete mode 100644 migrations/dlu/14_reward_codes.sql delete mode 100644 migrations/dlu/15_behavior_owner.sql delete mode 100644 migrations/dlu/16_big_behaviors.sql delete mode 100644 migrations/dlu/1_unique_charinfo_names.sql delete mode 100644 migrations/dlu/2_reporter_id.sql delete mode 100644 migrations/dlu/3_add_performance_cost.sql delete mode 100644 migrations/dlu/4_friends_list_objectids.sql delete mode 100644 migrations/dlu/5_brick_model_sd0.sql delete mode 100644 migrations/dlu/6_property_behaviors.sql delete mode 100644 migrations/dlu/7_make_play_key_id_nullable.sql delete mode 100644 migrations/dlu/8_foreign_play_key.sql delete mode 100644 migrations/dlu/9_Update_Leaderboard_Storage.sql diff --git a/migrations/dlu/0_initial.sql b/migrations/dlu/0_initial.sql index f381fa4ef..887c61da9 100644 --- a/migrations/dlu/0_initial.sql +++ b/migrations/dlu/0_initial.sql @@ -101,7 +101,8 @@ last_updated BIGINT NOT NULL, time_claimed BIGINT NOT NULL, rejection_reason TEXT NOT NULL, reputation BIGINT NOT NULL, -zone_id INTEGER NOT NULL +zone_id INTEGER NOT NULL, +performance_cost DOUBLE DEFAULT 0.0 ); CREATE TABLE IF NOT EXISTS ugc ( @@ -149,7 +150,8 @@ body TEXT NOT NULL, client_version TEXT NOT NULL, other_player_id TEXT NOT NULL, selection TEXT NOT NULL, -submitted DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP +submitted DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, +reporter_id INTEGER NOT NULL DEFAULT 0 ); CREATE TABLE IF NOT EXISTS servers ( @@ -160,3 +162,37 @@ port INTEGER NOT NULL, state INTEGER NOT NULL, version INTEGER NOT NULL DEFAULT 0 ); + +CREATE TABLE IF NOT EXISTS player_cheat_detections ( + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + account_id INTEGER REFERENCES accounts(id), + name TEXT NOT NULL, + violation_msg TEXT NOT NULL, + violation_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + violation_system_address TEXT NOT NULL +); + +CREATE TABLE IF NOT EXISTS ugc_modular_build ( + ugc_id BIGINT NOT NULL PRIMARY KEY, + character_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE, + ldf_config VARCHAR(60) NOT NULL +); + +CREATE TABLE IF NOT EXISTS ignore_list ( + player_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE, + ignored_player_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE, + + PRIMARY KEY (player_id, ignored_player_id) +); + +CREATE TABLE IF NOT EXISTS accounts_rewardcodes ( + account_id INTEGER NOT NULL REFERENCES accounts(id) ON DELETE CASCADE, + rewardcode INTEGER NOT NULL, + PRIMARY KEY (account_id, rewardcode) +); + +CREATE TABLE IF NOT EXISTS behaviors ( + behavior_info TEXT NOT NULL, + behavior_id BIGINT NOT NULL PRIMARY KEY, + character_id BIGINT NOT NULL DEFAULT 0 +); diff --git a/migrations/dlu/10_Security_updates.sql b/migrations/dlu/10_Security_updates.sql deleted file mode 100644 index 817b7973c..000000000 --- a/migrations/dlu/10_Security_updates.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE TABLE IF NOT EXISTS player_cheat_detections ( - id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, - account_id INTEGER REFERENCES accounts(id), - name TEXT REFERENCES charinfo(name), - violation_msg TEXT NOT NULL, - violation_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - violation_system_address TEXT NOT NULL -); diff --git a/migrations/dlu/11_fix_cheat_detection_table.sql b/migrations/dlu/11_fix_cheat_detection_table.sql deleted file mode 100644 index b3dccf046..000000000 --- a/migrations/dlu/11_fix_cheat_detection_table.sql +++ /dev/null @@ -1,9 +0,0 @@ -DROP TABLE IF EXISTS `player_cheat_detections`; -CREATE TABLE IF NOT EXISTS player_cheat_detections ( - id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, - account_id INTEGER REFERENCES accounts(id), - name TEXT NOT NULL, - violation_msg TEXT NOT NULL, - violation_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - violation_system_address TEXT NOT NULL -); diff --git a/migrations/dlu/12_modular_build_ugc.sql b/migrations/dlu/12_modular_build_ugc.sql deleted file mode 100644 index 68e417bf4..000000000 --- a/migrations/dlu/12_modular_build_ugc.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE IF NOT EXISTS ugc_modular_build ( - ugc_id BIGINT NOT NULL PRIMARY KEY, - character_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE, - ldf_config VARCHAR(60) NOT NULL -); diff --git a/migrations/dlu/13_ignore_list.sql b/migrations/dlu/13_ignore_list.sql deleted file mode 100644 index 2550beb58..000000000 --- a/migrations/dlu/13_ignore_list.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE IF NOT EXISTS ignore_list ( - player_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE, - ignored_player_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE, - - PRIMARY KEY (player_id, ignored_player_id) -); diff --git a/migrations/dlu/14_reward_codes.sql b/migrations/dlu/14_reward_codes.sql deleted file mode 100644 index ddadd7f29..000000000 --- a/migrations/dlu/14_reward_codes.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE IF NOT EXISTS accounts_rewardcodes ( - account_id INTEGER NOT NULL REFERENCES accounts(id) ON DELETE CASCADE, - rewardcode INTEGER NOT NULL, - PRIMARY KEY (account_id, rewardcode) -); diff --git a/migrations/dlu/15_behavior_owner.sql b/migrations/dlu/15_behavior_owner.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/migrations/dlu/16_big_behaviors.sql b/migrations/dlu/16_big_behaviors.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/migrations/dlu/1_unique_charinfo_names.sql b/migrations/dlu/1_unique_charinfo_names.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/migrations/dlu/2_reporter_id.sql b/migrations/dlu/2_reporter_id.sql deleted file mode 100644 index d386a8b96..000000000 --- a/migrations/dlu/2_reporter_id.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE bug_reports ADD reporter_id INTEGER NOT NULL DEFAULT 0; diff --git a/migrations/dlu/3_add_performance_cost.sql b/migrations/dlu/3_add_performance_cost.sql deleted file mode 100644 index cea7c0768..000000000 --- a/migrations/dlu/3_add_performance_cost.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE properties ADD COLUMN performance_cost DOUBLE DEFAULT 0.0; diff --git a/migrations/dlu/4_friends_list_objectids.sql b/migrations/dlu/4_friends_list_objectids.sql deleted file mode 100644 index efb3a7ae2..000000000 --- a/migrations/dlu/4_friends_list_objectids.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE friends SET player_id = player_id % 0x100000000, friend_id = friend_id % 0x100000000; \ No newline at end of file diff --git a/migrations/dlu/5_brick_model_sd0.sql b/migrations/dlu/5_brick_model_sd0.sql deleted file mode 100644 index 895f8b349..000000000 --- a/migrations/dlu/5_brick_model_sd0.sql +++ /dev/null @@ -1 +0,0 @@ -# This file is here as a mock. The real migration is located in BrickByBrickFix.cpp diff --git a/migrations/dlu/6_property_behaviors.sql b/migrations/dlu/6_property_behaviors.sql deleted file mode 100644 index a5d2806dd..000000000 --- a/migrations/dlu/6_property_behaviors.sql +++ /dev/null @@ -1,2 +0,0 @@ -UPDATE properties_contents SET model_name = "Objects_" || lot || "_name" WHERE model_name = ""; -CREATE TABLE IF NOT EXISTS behaviors (behavior_info TEXT NOT NULL, behavior_id BIGINT NOT NULL PRIMARY KEY, character_id BIGINT NOT NULL DEFAULT 0); diff --git a/migrations/dlu/7_make_play_key_id_nullable.sql b/migrations/dlu/7_make_play_key_id_nullable.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/migrations/dlu/8_foreign_play_key.sql b/migrations/dlu/8_foreign_play_key.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/migrations/dlu/9_Update_Leaderboard_Storage.sql b/migrations/dlu/9_Update_Leaderboard_Storage.sql deleted file mode 100644 index e69de29bb..000000000