mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
compartment table
This commit is contained in:
10
src/db/schema/Compartment.ts
Normal file
10
src/db/schema/Compartment.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { pgTable, integer, varchar, text,uuid} from "drizzle-orm/pg-core";
|
||||||
|
import { sql } from "drizzle-orm";
|
||||||
|
import { timestamps } from "./helpers/columns.helpers";
|
||||||
|
|
||||||
|
export const compartment = pgTable("compartment", {
|
||||||
|
id: uuid().defaultRandom().primaryKey().notNull(),
|
||||||
|
name: varchar({ length: 100 }).notNull(),
|
||||||
|
description: varchar({ length: 300 }),
|
||||||
|
...timestamps
|
||||||
|
});
|
||||||
@@ -1,13 +1,3 @@
|
|||||||
import { relations } from "drizzle-orm/relations";
|
import { relations } from "drizzle-orm/relations";
|
||||||
import { balAccounts, builds } from "./schema";
|
import { } from "./schema";
|
||||||
|
|
||||||
export const buildsRelations = relations(builds, ({one}) => ({
|
|
||||||
balAccount: one(balAccounts, {
|
|
||||||
fields: [builds.accountId],
|
|
||||||
references: [balAccounts.id]
|
|
||||||
}),
|
|
||||||
}));
|
|
||||||
|
|
||||||
export const balAccountsRelations = relations(balAccounts, ({many}) => ({
|
|
||||||
builds: many(builds),
|
|
||||||
}));
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { pgTable, integer, varchar, timestamp, text, numeric, unique, foreignKey, doublePrecision, real } from "drizzle-orm/pg-core"
|
import { pgTable, integer, varchar, timestamp, text, numeric, unique, uuid, doublePrecision } from "drizzle-orm/pg-core"
|
||||||
import { sql } from "drizzle-orm"
|
import { sql } from "drizzle-orm"
|
||||||
|
|
||||||
|
|
||||||
@@ -99,14 +99,15 @@ export const builds = pgTable("builds", {
|
|||||||
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
}, (table) => {
|
});
|
||||||
return {
|
|
||||||
buildsBalAccountsFk: foreignKey({
|
export const compartment = pgTable("compartment", {
|
||||||
columns: [table.accountId],
|
id: uuid().defaultRandom().primaryKey().notNull(),
|
||||||
foreignColumns: [balAccounts.id],
|
name: varchar({ length: 100 }).notNull(),
|
||||||
name: "builds_bal_accounts_fk"
|
description: varchar({ length: 300 }),
|
||||||
}),
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
}
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const lipseycatalog = pgTable("lipseycatalog", {
|
export const lipseycatalog = pgTable("lipseycatalog", {
|
||||||
@@ -202,35 +203,3 @@ export const balResellers = pgTable("bal_resellers", {
|
|||||||
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const psa = pgTable("psa", {
|
|
||||||
sku: varchar("SKU", { length: 50 }),
|
|
||||||
manufacturerId: varchar("Manufacturer Id", { length: 50 }),
|
|
||||||
brandName: varchar("Brand Name", { length: 50 }),
|
|
||||||
productName: varchar("Product Name", { length: 256 }),
|
|
||||||
longDescription: text("Long Description"),
|
|
||||||
shortDescription: varchar("Short Description", { length: 50 }),
|
|
||||||
department: varchar("Department", { length: 50 }),
|
|
||||||
category: varchar("Category", { length: 50 }),
|
|
||||||
subCategory: varchar("SubCategory", { length: 50 }),
|
|
||||||
thumbUrl: varchar("Thumb URL", { length: 150 }),
|
|
||||||
imageUrl: varchar("Image URL", { length: 150 }),
|
|
||||||
buyLink: varchar("Buy Link", { length: 128 }),
|
|
||||||
keywords: varchar("Keywords", { length: 50 }),
|
|
||||||
reviews: varchar("Reviews", { length: 50 }),
|
|
||||||
retailPrice: real("Retail Price"),
|
|
||||||
salePrice: real("Sale Price"),
|
|
||||||
brandPageLink: varchar("Brand Page Link", { length: 50 }),
|
|
||||||
brandLogoImage: varchar("Brand Logo Image", { length: 50 }),
|
|
||||||
productPageViewTracking: varchar("Product Page View Tracking", { length: 256 }),
|
|
||||||
parentGroupId: varchar("Parent Group ID", { length: 50 }),
|
|
||||||
fineline: varchar("Fineline", { length: 50 }),
|
|
||||||
superFineline: varchar("SuperFineline", { length: 250 }),
|
|
||||||
modelNumber: varchar("ModelNumber", { length: 50 }),
|
|
||||||
caliber: varchar("Caliber", { length: 255 }),
|
|
||||||
upc: varchar("UPC", { length: 75 }),
|
|
||||||
mediumImageUrl: varchar("Medium Image URL", { length: 50 }),
|
|
||||||
productContentWidget: varchar("Product Content Widget", { length: 256 }),
|
|
||||||
googleCategorization: varchar("Google Categorization", { length: 50 }),
|
|
||||||
itemBasedCommission: varchar("Item Based Commission", { length: 50 }),
|
|
||||||
});
|
|
||||||
|
|||||||
Reference in New Issue
Block a user