Refactor database models to majorly increase queries needed and decrease load times of home from 30 secs to 5 sec (we will be caching the rest to decrease even further via background tasks)

This commit is contained in:
badblocks 2025-03-17 14:08:01 -07:00
parent f7a9b2f823
commit 86c7eba10a
25 changed files with 1941 additions and 1560 deletions

View file

@ -1,112 +0,0 @@
[
{
"model": "cards.rarity",
"pk": 1,
"fields": {
"icons": "🔷",
"normalized_id": 1,
"name": "Common",
"created_at": "2025-02-16T06:54:40.993Z",
"updated_at": "2025-02-16T06:54:40.993Z"
}
},
{
"model": "cards.rarity",
"pk": 2,
"fields": {
"icons": "🔷🔷",
"normalized_id": 2,
"name": "Uncommon",
"created_at": "2025-02-16T06:54:44.213Z",
"updated_at": "2025-02-16T06:54:44.213Z"
}
},
{
"model": "cards.rarity",
"pk": 3,
"fields": {
"icons": "🔷🔷🔷",
"normalized_id": 3,
"name": "Rare",
"created_at": "2025-02-16T06:54:47.297Z",
"updated_at": "2025-02-16T06:54:47.297Z"
}
},
{
"model": "cards.rarity",
"pk": 4,
"fields": {
"icons": "🔷🔷🔷🔷",
"normalized_id": 4,
"name": "Double Rare",
"created_at": "2025-02-16T06:54:50.363Z",
"updated_at": "2025-02-16T06:54:50.363Z"
}
},
{
"model": "cards.rarity",
"pk": 5,
"fields": {
"icons": "⭐️",
"normalized_id": 5,
"name": "Full Art Rare",
"created_at": "2025-02-16T06:54:59.888Z",
"updated_at": "2025-02-16T06:54:59.888Z"
}
},
{
"model": "cards.rarity",
"pk": 6,
"fields": {
"icons": "⭐️⭐️",
"normalized_id": 6,
"name": "Super Rare",
"created_at": "2025-02-16T06:55:02.853Z",
"updated_at": "2025-02-16T06:55:02.853Z"
}
},
{
"model": "cards.rarity",
"pk": 7,
"fields": {
"icons": "🌟🌟",
"normalized_id": 6,
"name": "Special Art Rare",
"created_at": "2025-02-16T06:55:02.853Z",
"updated_at": "2025-02-16T06:55:02.853Z"
}
},
{
"model": "cards.rarity",
"pk": 8,
"fields": {
"icons": "⭐️⭐️⭐️",
"normalized_id": 7,
"name": "Immersive Rare",
"created_at": "2025-02-16T06:55:05.728Z",
"updated_at": "2025-02-16T06:55:05.728Z"
}
},
{
"model": "cards.rarity",
"pk": 9,
"fields": {
"icons": "👑",
"normalized_id": 8,
"name": "Crown Rare",
"created_at": "2025-02-16T06:55:13.907Z",
"updated_at": "2025-02-16T06:55:13.907Z"
}
},
{
"model": "cards.rarity",
"pk": 10,
"fields": {
"icons": "🅿️",
"normalized_id": 9,
"name": "Promo",
"created_at": "2025-02-16T06:55:13.907Z",
"updated_at": "2025-02-16T06:55:13.907Z"
}
}
]

View file

@ -1,38 +0,0 @@
[
{
"model": "cards.cardset",
"pk": 1,
"fields": {
"name": "Promo-A",
"created_at": "2025-02-16T07:54:38.986Z",
"updated_at": "2025-02-16T07:54:38.986Z"
}
},
{
"model": "cards.cardset",
"pk": 2,
"fields": {
"name": "A1",
"created_at": "2025-02-16T07:54:04.325Z",
"updated_at": "2025-02-16T07:54:04.325Z"
}
},
{
"model": "cards.cardset",
"pk": 3,
"fields": {
"name": "A1a",
"created_at": "2025-02-16T07:54:08.471Z",
"updated_at": "2025-02-16T07:54:08.471Z"
}
},
{
"model": "cards.cardset",
"pk": 4,
"fields": {
"name": "A2",
"created_at": "2025-02-16T07:54:11.435Z",
"updated_at": "2025-02-16T07:54:11.435Z"
}
}
]

View file

@ -4,7 +4,7 @@
"pk": 1,
"fields": {
"name": "Promo-A",
"cardset": 1,
"cardset": "Promo-A",
"hex_color": "#1070EB",
"created_at": "2025-02-16T07:55:34.988Z",
"updated_at": "2025-02-16T07:55:34.988Z"
@ -15,7 +15,7 @@
"pk": 2,
"fields": {
"name": "Genetic Apex: Mewtwo",
"cardset": 2,
"cardset": "A1",
"hex_color": "#8040E0",
"created_at": "2025-02-16T07:54:57.445Z",
"updated_at": "2025-02-16T07:54:57.445Z"
@ -26,7 +26,7 @@
"pk": 3,
"fields": {
"name": "Genetic Apex: Charizard",
"cardset": 2,
"cardset": "A1",
"hex_color": "#E00202",
"created_at": "2025-02-16T07:54:52.381Z",
"updated_at": "2025-02-16T07:54:52.381Z"
@ -37,7 +37,7 @@
"pk": 4,
"fields": {
"name": "Genetic Apex: Pikachu",
"cardset": 2,
"cardset": "A1",
"hex_color": "#EB8600",
"created_at": "2025-02-16T07:55:05.097Z",
"updated_at": "2025-02-16T07:55:05.097Z"
@ -48,7 +48,7 @@
"pk": 5,
"fields": {
"name": "Mythical Island",
"cardset": 3,
"cardset": "A1a",
"hex_color": "#20AA80",
"created_at": "2025-02-16T07:55:11.916Z",
"updated_at": "2025-02-16T07:55:11.916Z"
@ -59,7 +59,7 @@
"pk": 6,
"fields": {
"name": "Space-Time Smackdown: Dialga",
"cardset": 4,
"cardset": "A2",
"hex_color": "#302FD9",
"created_at": "2025-02-16T07:55:17.582Z",
"updated_at": "2025-02-16T07:55:17.582Z"
@ -70,7 +70,7 @@
"pk": 7,
"fields": {
"name": "Space-Time Smackdown: Palkia",
"cardset": 4,
"cardset": "A2",
"hex_color": "#CF36E0",
"created_at": "2025-02-16T07:55:27.503Z",
"updated_at": "2025-02-16T07:55:27.503Z"

File diff suppressed because it is too large Load diff

View file

@ -6,6 +6,8 @@
"is_closed": false,
"hash": "8775ce1cz",
"initiated_by": 1,
"rarity_icon": "🔷🔷",
"rarity_level": 2,
"created_at": "2025-03-13T04:38:41.385Z",
"updated_at": "2025-03-13T04:38:41.385Z"
}
@ -17,6 +19,8 @@
"is_closed": false,
"hash": "daa6300dz",
"initiated_by": 1,
"rarity_icon": "🔷",
"rarity_level": 1,
"created_at": "2025-03-13T04:39:25.777Z",
"updated_at": "2025-03-13T04:39:25.777Z"
}
@ -28,6 +32,8 @@
"is_closed": false,
"hash": "e6cdbdf8z",
"initiated_by": 1,
"rarity_icon": "🔷🔷🔷",
"rarity_level": 3,
"created_at": "2025-03-13T04:40:07.727Z",
"updated_at": "2025-03-13T04:40:07.727Z"
}
@ -39,6 +45,8 @@
"is_closed": false,
"hash": "a975713ez",
"initiated_by": 1,
"rarity_icon": "🔷🔷🔷🔷",
"rarity_level": 4,
"created_at": "2025-03-13T04:40:29.957Z",
"updated_at": "2025-03-13T04:40:29.957Z"
}
@ -50,6 +58,8 @@
"is_closed": false,
"hash": "37dc0786z",
"initiated_by": 1,
"rarity_icon": "⭐️",
"rarity_level": 5,
"created_at": "2025-03-13T04:41:00.359Z",
"updated_at": "2025-03-13T04:41:00.359Z"
}
@ -61,6 +71,8 @@
"is_closed": false,
"hash": "f10208bdz",
"initiated_by": 1,
"rarity_icon": "🔷",
"rarity_level": 1,
"created_at": "2025-03-13T04:41:31.231Z",
"updated_at": "2025-03-13T04:41:31.231Z"
}
@ -72,6 +84,8 @@
"is_closed": false,
"hash": "88963192z",
"initiated_by": 1,
"rarity_icon": "🔷🔷",
"rarity_level": 2,
"created_at": "2025-03-13T04:43:07.737Z",
"updated_at": "2025-03-13T04:43:07.737Z"
}
@ -83,6 +97,8 @@
"is_closed": false,
"hash": "31a7aee8z",
"initiated_by": 1,
"rarity_icon": "🔷🔷🔷",
"rarity_level": 3,
"created_at": "2025-03-13T04:44:05.193Z",
"updated_at": "2025-03-13T04:44:05.193Z"
}
@ -94,6 +110,8 @@
"is_closed": false,
"hash": "7a79e1f7z",
"initiated_by": 1,
"rarity_icon": "🔷🔷🔷🔷",
"rarity_level": 4,
"created_at": "2025-03-13T04:44:35.634Z",
"updated_at": "2025-03-13T04:44:35.634Z"
}
@ -105,6 +123,8 @@
"is_closed": false,
"hash": "a465a255z",
"initiated_by": 1,
"rarity_icon": "⭐️",
"rarity_level": 5,
"created_at": "2025-03-13T04:45:02.040Z",
"updated_at": "2025-03-13T04:45:02.040Z"
}
@ -116,6 +136,8 @@
"is_closed": false,
"hash": "9d871edbz",
"initiated_by": 1,
"rarity_icon": "🔷🔷🔷🔷",
"rarity_level": 4,
"created_at": "2025-03-13T04:45:34.815Z",
"updated_at": "2025-03-13T04:45:34.815Z"
}
@ -127,6 +149,8 @@
"is_closed": false,
"hash": "32b34a89z",
"initiated_by": 2,
"rarity_icon": "🔷",
"rarity_level": 1,
"created_at": "2025-03-13T04:54:17.809Z",
"updated_at": "2025-03-13T04:54:17.809Z"
}
@ -138,6 +162,8 @@
"is_closed": false,
"hash": "f747edbdz",
"initiated_by": 2,
"rarity_icon": "🔷",
"rarity_level": 1,
"created_at": "2025-03-13T04:55:33.344Z",
"updated_at": "2025-03-13T04:55:33.344Z"
}
@ -149,6 +175,8 @@
"is_closed": false,
"hash": "9a13333dz",
"initiated_by": 2,
"rarity_icon": "🔷",
"rarity_level": 1,
"created_at": "2025-03-13T04:58:02.062Z",
"updated_at": "2025-03-13T04:58:02.062Z"
}
@ -160,6 +188,8 @@
"is_closed": false,
"hash": "5b0d6871z",
"initiated_by": 2,
"rarity_icon": "🔷",
"rarity_level": 1,
"created_at": "2025-03-13T04:59:11.177Z",
"updated_at": "2025-03-13T04:59:11.177Z"
}
@ -171,6 +201,8 @@
"is_closed": false,
"hash": "f012360cz",
"initiated_by": 2,
"rarity_icon": "🔷🔷",
"rarity_level": 2,
"created_at": "2025-03-13T05:00:49.530Z",
"updated_at": "2025-03-13T05:00:49.530Z"
}
@ -182,6 +214,8 @@
"is_closed": false,
"hash": "a6e927eaz",
"initiated_by": 2,
"rarity_icon": "🔷🔷",
"rarity_level": 2,
"created_at": "2025-03-13T05:00:53.037Z",
"updated_at": "2025-03-13T05:00:53.037Z"
}
@ -193,6 +227,8 @@
"is_closed": false,
"hash": "a5ec89b7z",
"initiated_by": 2,
"rarity_icon": "🔷🔷",
"rarity_level": 2,
"created_at": "2025-03-13T05:02:36.926Z",
"updated_at": "2025-03-13T05:02:36.926Z"
}
@ -204,6 +240,8 @@
"is_closed": false,
"hash": "ebf6a095z",
"initiated_by": 2,
"rarity_icon": "🔷🔷",
"rarity_level": 2,
"created_at": "2025-03-13T05:03:39.241Z",
"updated_at": "2025-03-13T05:03:39.241Z"
}
@ -215,6 +253,8 @@
"is_closed": false,
"hash": "c7541b41z",
"initiated_by": 2,
"rarity_icon": "🔷🔷",
"rarity_level": 2,
"created_at": "2025-03-13T05:05:22.304Z",
"updated_at": "2025-03-13T05:05:22.304Z"
}
@ -226,6 +266,8 @@
"is_closed": false,
"hash": "2b97019dz",
"initiated_by": 2,
"rarity_icon": "🔷🔷",
"rarity_level": 2,
"created_at": "2025-03-13T05:08:31.437Z",
"updated_at": "2025-03-13T05:08:31.437Z"
}
@ -237,6 +279,8 @@
"is_closed": false,
"hash": "5d90ca78z",
"initiated_by": 2,
"rarity_icon": "🔷🔷",
"rarity_level": 2,
"created_at": "2025-03-13T05:09:40.853Z",
"updated_at": "2025-03-13T05:09:40.853Z"
}