preciazo/db-datos/schema.ts

15 lines
563 B
TypeScript
Raw Normal View History

2023-12-23 23:14:05 +00:00
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
2023-12-21 17:00:00 +00:00
export const precios = sqliteTable("precios", {
id: integer("id", { mode: "number" }).primaryKey({ autoIncrement: true }),
ean: text("ean").notNull(),
2023-12-22 18:45:20 +00:00
fetchedAt: integer("fetched_at", { mode: "timestamp" }).notNull(),
precioCentavos: integer("precio_centavos"),
inStock: integer("in_stock", { mode: "boolean" }),
2023-12-23 23:14:05 +00:00
url: text("url").notNull(),
2023-12-23 23:35:43 +00:00
warcRecordId: text("warc_record_id"),
parserVersion: integer("parser_version"),
2023-12-21 17:00:00 +00:00
});
2023-12-23 23:14:05 +00:00
export type Precio = typeof precios.$inferSelect;