index ean, fetched_at

This commit is contained in:
Cat /dev/Nulo 2024-08-04 15:35:43 -03:00
parent d87fa5f905
commit 8617a0b2a5
18 changed files with 283 additions and 76 deletions

View file

@ -0,0 +1 @@
CREATE INDEX `precios_ean_fetched_at_idx` ON `precios` (`ean`,`fetched_at`);

View file

@ -1,8 +1,6 @@
{ {
"version": "5", "version": "6",
"dialect": "sqlite", "dialect": "sqlite",
"id": "88aa0254-106e-424e-ab66-417ff44bbf0b",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": { "tables": {
"precios": { "precios": {
"name": "precios", "name": "precios",
@ -58,8 +56,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"schemas": {},
"tables": {}, "tables": {},
"columns": {} "columns": {}
} },
"id": "88aa0254-106e-424e-ab66-417ff44bbf0b",
"prevId": "00000000-0000-0000-0000-000000000000"
} }

View file

@ -1,8 +1,6 @@
{ {
"version": "5", "version": "6",
"dialect": "sqlite", "dialect": "sqlite",
"id": "a565621c-046e-4f4d-b505-104e2c4f2b6c",
"prevId": "88aa0254-106e-424e-ab66-417ff44bbf0b",
"tables": { "tables": {
"precios": { "precios": {
"name": "precios", "name": "precios",
@ -72,8 +70,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"schemas": {},
"tables": {}, "tables": {},
"columns": {} "columns": {}
} },
"id": "a565621c-046e-4f4d-b505-104e2c4f2b6c",
"prevId": "88aa0254-106e-424e-ab66-417ff44bbf0b"
} }

View file

@ -1,8 +1,6 @@
{ {
"version": "5", "version": "6",
"dialect": "sqlite", "dialect": "sqlite",
"id": "cbd90a60-7568-489f-ac45-95bd8818ffbd",
"prevId": "a565621c-046e-4f4d-b505-104e2c4f2b6c",
"tables": { "tables": {
"precios": { "precios": {
"name": "precios", "name": "precios",
@ -86,8 +84,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"schemas": {},
"tables": {}, "tables": {},
"columns": {} "columns": {}
} },
"id": "cbd90a60-7568-489f-ac45-95bd8818ffbd",
"prevId": "a565621c-046e-4f4d-b505-104e2c4f2b6c"
} }

View file

@ -1,8 +1,6 @@
{ {
"version": "5", "version": "6",
"dialect": "sqlite", "dialect": "sqlite",
"id": "e1217fdb-6f54-44c5-a04b-c5aebf202102",
"prevId": "cbd90a60-7568-489f-ac45-95bd8818ffbd",
"tables": { "tables": {
"precios": { "precios": {
"name": "precios", "name": "precios",
@ -94,8 +92,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"schemas": {},
"tables": {}, "tables": {},
"columns": {} "columns": {}
} },
"id": "e1217fdb-6f54-44c5-a04b-c5aebf202102",
"prevId": "cbd90a60-7568-489f-ac45-95bd8818ffbd"
} }

View file

@ -1,7 +1,5 @@
{ {
"id": "bf90a1cd-ae6a-4dba-a1aa-79f14a11d958", "version": "6",
"prevId": "e1217fdb-6f54-44c5-a04b-c5aebf202102",
"version": "5",
"dialect": "sqlite", "dialect": "sqlite",
"tables": { "tables": {
"precios": { "precios": {
@ -94,8 +92,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"columns": {}, "tables": {},
"schemas": {}, "columns": {}
"tables": {} },
} "id": "bf90a1cd-ae6a-4dba-a1aa-79f14a11d958",
"prevId": "e1217fdb-6f54-44c5-a04b-c5aebf202102"
} }

View file

@ -1,7 +1,5 @@
{ {
"id": "f2cf47b9-e137-41c9-b7fb-6bc016588db0", "version": "6",
"prevId": "bf90a1cd-ae6a-4dba-a1aa-79f14a11d958",
"version": "5",
"dialect": "sqlite", "dialect": "sqlite",
"tables": { "tables": {
"precios": { "precios": {
@ -94,8 +92,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"columns": {}, "tables": {},
"schemas": {}, "columns": {}
"tables": {} },
} "id": "f2cf47b9-e137-41c9-b7fb-6bc016588db0",
"prevId": "bf90a1cd-ae6a-4dba-a1aa-79f14a11d958"
} }

View file

@ -1,7 +1,5 @@
{ {
"id": "ac099405-ecd0-4637-ae5e-fb29c9847e45", "version": "6",
"prevId": "f2cf47b9-e137-41c9-b7fb-6bc016588db0",
"version": "5",
"dialect": "sqlite", "dialect": "sqlite",
"tables": { "tables": {
"precios": { "precios": {
@ -94,8 +92,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"columns": {}, "tables": {},
"schemas": {}, "columns": {}
"tables": {} },
} "id": "ac099405-ecd0-4637-ae5e-fb29c9847e45",
"prevId": "f2cf47b9-e137-41c9-b7fb-6bc016588db0"
} }

View file

@ -1,7 +1,5 @@
{ {
"id": "9d2f23bf-dc60-4adb-b1bd-ec75e90dda25", "version": "6",
"prevId": "ac099405-ecd0-4637-ae5e-fb29c9847e45",
"version": "5",
"dialect": "sqlite", "dialect": "sqlite",
"tables": { "tables": {
"precios": { "precios": {
@ -94,8 +92,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"columns": {}, "tables": {},
"schemas": {}, "columns": {}
"tables": {} },
} "id": "9d2f23bf-dc60-4adb-b1bd-ec75e90dda25",
"prevId": "ac099405-ecd0-4637-ae5e-fb29c9847e45"
} }

View file

@ -1,7 +1,5 @@
{ {
"id": "082630a9-3744-4e33-bde5-06045ca57d36", "version": "6",
"prevId": "9d2f23bf-dc60-4adb-b1bd-ec75e90dda25",
"version": "5",
"dialect": "sqlite", "dialect": "sqlite",
"tables": { "tables": {
"precios": { "precios": {
@ -94,8 +92,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"columns": {}, "tables": {},
"schemas": {}, "columns": {}
"tables": {} },
} "id": "082630a9-3744-4e33-bde5-06045ca57d36",
"prevId": "9d2f23bf-dc60-4adb-b1bd-ec75e90dda25"
} }

View file

@ -1,8 +1,6 @@
{ {
"version": "5", "version": "6",
"dialect": "sqlite", "dialect": "sqlite",
"id": "2e398920-ffaf-4d55-ae13-d906cb9e0efa",
"prevId": "082630a9-3744-4e33-bde5-06045ca57d36",
"tables": { "tables": {
"precios": { "precios": {
"name": "precios", "name": "precios",
@ -139,8 +137,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"schemas": {},
"tables": {}, "tables": {},
"columns": {} "columns": {}
} },
"id": "2e398920-ffaf-4d55-ae13-d906cb9e0efa",
"prevId": "082630a9-3744-4e33-bde5-06045ca57d36"
} }

View file

@ -1,8 +1,6 @@
{ {
"version": "5", "version": "6",
"dialect": "sqlite", "dialect": "sqlite",
"id": "c8297337-4ed8-432e-8782-65d41be42e00",
"prevId": "2e398920-ffaf-4d55-ae13-d906cb9e0efa",
"tables": { "tables": {
"db_best_selling": { "db_best_selling": {
"name": "db_best_selling", "name": "db_best_selling",
@ -176,8 +174,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"schemas": {},
"tables": {}, "tables": {},
"columns": {} "columns": {}
} },
"id": "c8297337-4ed8-432e-8782-65d41be42e00",
"prevId": "2e398920-ffaf-4d55-ae13-d906cb9e0efa"
} }

View file

@ -1,8 +1,6 @@
{ {
"version": "5", "version": "6",
"dialect": "sqlite", "dialect": "sqlite",
"id": "8b4921b5-6ecd-4d69-ba64-9b0bfb53db84",
"prevId": "c8297337-4ed8-432e-8782-65d41be42e00",
"tables": { "tables": {
"db_best_selling": { "db_best_selling": {
"name": "db_best_selling", "name": "db_best_selling",
@ -183,8 +181,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"schemas": {},
"tables": {}, "tables": {},
"columns": {} "columns": {}
} },
"id": "8b4921b5-6ecd-4d69-ba64-9b0bfb53db84",
"prevId": "c8297337-4ed8-432e-8782-65d41be42e00"
} }

View file

@ -1,8 +1,6 @@
{ {
"version": "5", "version": "6",
"dialect": "sqlite", "dialect": "sqlite",
"id": "16046188-ab24-4bd4-bfb4-8a81f24c6f28",
"prevId": "8b4921b5-6ecd-4d69-ba64-9b0bfb53db84",
"tables": { "tables": {
"db_best_selling": { "db_best_selling": {
"name": "db_best_selling", "name": "db_best_selling",
@ -190,8 +188,9 @@
}, },
"enums": {}, "enums": {},
"_meta": { "_meta": {
"schemas": {},
"tables": {}, "tables": {},
"columns": {} "columns": {}
} },
"id": "16046188-ab24-4bd4-bfb4-8a81f24c6f28",
"prevId": "8b4921b5-6ecd-4d69-ba64-9b0bfb53db84"
} }

View file

@ -0,0 +1,208 @@
{
"version": "6",
"dialect": "sqlite",
"id": "c95c6547-d540-45cf-aa9d-9d828efb468e",
"prevId": "16046188-ab24-4bd4-bfb4-8a81f24c6f28",
"tables": {
"db_best_selling": {
"name": "db_best_selling",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"fetched_at": {
"name": "fetched_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"eans_json": {
"name": "eans_json",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"precios": {
"name": "precios",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"ean": {
"name": "ean",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"fetched_at": {
"name": "fetched_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"precio_centavos": {
"name": "precio_centavos",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"in_stock": {
"name": "in_stock",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"url": {
"name": "url",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"warc_record_id": {
"name": "warc_record_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"parser_version": {
"name": "parser_version",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"image_url": {
"name": "image_url",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"precios_ean_idx": {
"name": "precios_ean_idx",
"columns": [
"ean"
],
"isUnique": false
},
"precios_url_idx": {
"name": "precios_url_idx",
"columns": [
"url"
],
"isUnique": false
},
"precios_fetched_at_idx": {
"name": "precios_fetched_at_idx",
"columns": [
"fetched_at"
],
"isUnique": false
},
"precios_ean_fetched_at_idx": {
"name": "precios_ean_fetched_at_idx",
"columns": [
"ean",
"fetched_at"
],
"isUnique": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"producto_urls": {
"name": "producto_urls",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"url": {
"name": "url",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"first_seen": {
"name": "first_seen",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"last_seen": {
"name": "last_seen",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"producto_urls_url_unique": {
"name": "producto_urls_url_unique",
"columns": [
"url"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}

View file

@ -92,6 +92,13 @@
"when": 1719680946811, "when": 1719680946811,
"tag": "0012_hard_red_wolf", "tag": "0012_hard_red_wolf",
"breakpoints": true "breakpoints": true
},
{
"idx": 13,
"version": "6",
"when": 1722796469056,
"tag": "0013_harsh_starbolt",
"breakpoints": true
} }
] ]
} }

View file

@ -5,7 +5,7 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"generate": "drizzle-kit generate:sqlite", "generate": "drizzle-kit generate",
"migrate": "node migrate-cli.js" "migrate": "node migrate-cli.js"
}, },
"keywords": [], "keywords": [],

View file

@ -22,6 +22,10 @@ export const precios = sqliteTable(
preciosFetchedAtIdx: index("precios_fetched_at_idx").on( preciosFetchedAtIdx: index("precios_fetched_at_idx").on(
precios.fetchedAt precios.fetchedAt
), ),
preciosEanFetchedAtIdx: index("precios_ean_fetched_at_idx").on(
precios.ean,
precios.fetchedAt
),
}; };
} }
); );