From 0dcbe6fc2d29707469f8c1d6a5b7e90c2035a82b Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 22 Oct 2020 19:53:32 -0700 Subject: [PATCH] Add users and closet_hangers to local db schema --- package.json | 2 +- scripts/setup-mysql-dev-constants.sql | 2 +- scripts/setup-mysql-dev-schema.sql | 50 ++++++++++++++++++++++++++- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index deafa0d..bd8cccf 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "mysql-dev": "mysql --host=localhost --user=impress_2020_dev --password=impress_2020_dev --database=impress_2020_dev", "mysql-admin": "mysql --host=impress.openneo.net --user=matchu --password --database=openneo_impress", "mysqldump": "mysqldump --host=impress.openneo.net --user=$(dotenv -p IMPRESS_MYSQL_USER) --password=$(dotenv -p IMPRESS_MYSQL_PASSWORD) --column-statistics=0", - "download-mysql-schema": "yarn --silent mysqldump --no-data openneo_impress items item_translations modeling_logs parents_swf_assets pet_types pet_states swf_assets | sed 's/ AUTO_INCREMENT=[0-9]*//g' > scripts/setup-mysql-dev-schema.sql && yarn --silent mysqldump openneo_impress species species_translations colors color_translations zones zone_translations > scripts/setup-mysql-dev-constants.sql", + "download-mysql-schema": "yarn --silent mysqldump --no-data openneo_impress closet_hangers items item_translations modeling_logs parents_swf_assets pet_types pet_states swf_assets users | sed 's/ AUTO_INCREMENT=[0-9]*//g' > scripts/setup-mysql-dev-schema.sql && yarn --silent mysqldump openneo_impress species species_translations colors color_translations zones zone_translations > scripts/setup-mysql-dev-constants.sql", "setup-mysql": "yarn mysql-admin < scripts/setup-mysql.sql", "setup-mysql-dev": "yarn mysql-dev < scripts/setup-mysql-dev-constants.sql && yarn mysql-dev < scripts/setup-mysql-dev-schema.sql", "build-cached-data": "node -r dotenv/config scripts/build-cached-data.js", diff --git a/scripts/setup-mysql-dev-constants.sql b/scripts/setup-mysql-dev-constants.sql index a0993e6..df595ab 100644 --- a/scripts/setup-mysql-dev-constants.sql +++ b/scripts/setup-mysql-dev-constants.sql @@ -189,4 +189,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-10-06 6:59:56 +-- Dump completed on 2020-10-22 19:52:46 diff --git a/scripts/setup-mysql-dev-schema.sql b/scripts/setup-mysql-dev-schema.sql index f663d01..b171e65 100644 --- a/scripts/setup-mysql-dev-schema.sql +++ b/scripts/setup-mysql-dev-schema.sql @@ -15,6 +15,30 @@ /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +-- +-- Table structure for table `closet_hangers` +-- + +DROP TABLE IF EXISTS `closet_hangers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `closet_hangers` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `item_id` int(11) DEFAULT NULL, + `user_id` int(11) DEFAULT NULL, + `quantity` int(11) DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + `updated_at` datetime DEFAULT NULL, + `owned` tinyint(1) NOT NULL DEFAULT '1', + `list_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_closet_hangers_on_list_id` (`list_id`), + KEY `index_closet_hangers_on_user_id` (`user_id`), + KEY `index_closet_hangers_on_item_id_and_owned` (`item_id`,`owned`), + KEY `index_closet_hangers_test_20131226` (`user_id`,`list_id`,`item_id`,`owned`,`created_at`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `items` -- @@ -173,6 +197,30 @@ CREATE TABLE `swf_assets` ( KEY `swf_assets_type_and_id` (`type`,`remote_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `users` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `auth_server_id` tinyint(4) NOT NULL, + `remote_id` int(11) NOT NULL, + `points` int(11) NOT NULL DEFAULT '0', + `beta` tinyint(1) NOT NULL DEFAULT '0', + `remember_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `remember_created_at` datetime DEFAULT NULL, + `image_mode_tester` tinyint(1) NOT NULL DEFAULT '0', + `owned_closet_hangers_visibility` int(11) NOT NULL DEFAULT '1', + `wanted_closet_hangers_visibility` int(11) NOT NULL DEFAULT '1', + `contact_neopets_connection_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -183,4 +231,4 @@ CREATE TABLE `swf_assets` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-10-06 6:59:49 +-- Dump completed on 2020-10-22 19:52:36