mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-05 18:26:45 -05:00
modeling database
This commit is contained in:
1
package-lock.json
generated
1
package-lock.json
generated
@@ -4093,6 +4093,7 @@
|
||||
"version": "0.36.3",
|
||||
"resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.36.3.tgz",
|
||||
"integrity": "sha512-ffQB7CcyCTvQBK6xtRLMl/Jsd5xFTBs+UTHrgs1hbk68i5TPkbsoCPbKEwiEsQZfq2I7VH632XJpV1g7LS2H9Q==",
|
||||
"license": "Apache-2.0",
|
||||
"peerDependencies": {
|
||||
"@aws-sdk/client-rds-data": ">=3",
|
||||
"@cloudflare/workers-types": ">=3",
|
||||
|
||||
@@ -3,9 +3,12 @@ import { sql } from "drizzle-orm";
|
||||
import { timestamps } from "./columns.helpers";
|
||||
|
||||
export const accounts = pgTable("bal_accounts", {
|
||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "accountsid_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "accounts_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||
first_name: varchar({ length: 40 }),
|
||||
last_name: varchar({ length: 40 }),
|
||||
email: varchar({length: 100}),
|
||||
username: varchar({length:50}).notNull().unique(),
|
||||
password_hash: varchar({length:255}).notNull().unique(),
|
||||
|
||||
...timestamps
|
||||
})
|
||||
9
src/db/schema/baseTable.ts
Normal file
9
src/db/schema/baseTable.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { pgTable, integer, varchar } from "drizzle-orm/pg-core";
|
||||
import { sql } from "drizzle-orm";
|
||||
import { timestamps } from "./columns.helpers";
|
||||
|
||||
export const accounts = pgTable("base_table", {
|
||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "base_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||
|
||||
...timestamps
|
||||
})
|
||||
10
src/db/schema/categories.ts
Normal file
10
src/db/schema/categories.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { pgTable, integer, varchar } from "drizzle-orm/pg-core";
|
||||
import { sql } from "drizzle-orm";
|
||||
import { timestamps } from "./columns.helpers";
|
||||
|
||||
export const categories = pgTable("categories", {
|
||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "categories_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||
name: varchar({length: 100}).notNull(),
|
||||
parent_category_id: integer(),
|
||||
...timestamps
|
||||
})
|
||||
@@ -85,4 +85,4 @@ export const lipseycatalog = pgTable("lipseycatalog", {
|
||||
...timestamps
|
||||
});
|
||||
|
||||
;
|
||||
|
||||
|
||||
11
src/db/schema/product_feeds.ts
Normal file
11
src/db/schema/product_feeds.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { pgTable, integer, varchar, timestamp } from "drizzle-orm/pg-core";
|
||||
import { sql } from "drizzle-orm";
|
||||
import { timestamps } from "./columns.helpers";
|
||||
|
||||
export const product_feeds = pgTable("product_feeds", {
|
||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "productfeeds_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||
reseller_id: integer().notNull(),
|
||||
feed_url: varchar({ length:255 }).notNull(),
|
||||
last_update: timestamp(),
|
||||
...timestamps
|
||||
})
|
||||
14
src/db/schema/products.ts
Normal file
14
src/db/schema/products.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { pgTable, integer, varchar, text, decimal } from "drizzle-orm/pg-core";
|
||||
import { sql } from "drizzle-orm";
|
||||
import { timestamps } from "./columns.helpers";
|
||||
|
||||
export const products = pgTable("products", {
|
||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "products_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||
name: varchar({length: 255 }).notNull(),
|
||||
description: text().notNull(),
|
||||
price: decimal().notNull(),
|
||||
reseller_id: integer().notNull(),
|
||||
category_id: integer().notNull(),
|
||||
stock_qty: integer().default(0),
|
||||
...timestamps
|
||||
})
|
||||
11
src/db/schema/retailers.ts
Normal file
11
src/db/schema/retailers.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { pgTable, integer, varchar } from "drizzle-orm/pg-core";
|
||||
import { sql } from "drizzle-orm";
|
||||
import { timestamps } from "./columns.helpers";
|
||||
|
||||
export const resellers = pgTable("bal_resellers", {
|
||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "resellers_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||
name: varchar({ length: 100 }).notNull(),
|
||||
website_url: varchar({ length: 255 }),
|
||||
contact_email: varchar({length: 100}),
|
||||
...timestamps
|
||||
})
|
||||
Reference in New Issue
Block a user