import { pgTable, integer, varchar, text, doublePrecision, timestamp } from "drizzle-orm/pg-core"
import { sql } from "drizzle-orm"
import { timestamps } from "./helpers/columns.helpers";


export const LipseyCatalog = pgTable("lipseycatalog", {
	id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "lipseycatalog_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
	itemno: varchar({ length: 20 }).notNull(),
	description1: text(),
	description2: text(),
	upc: varchar({ length: 20 }),
	manufacturermodelno: varchar({ length: 30 }),
	msrp: doublePrecision(),
	model: text(),
	calibergauge: text(),
	manufacturer: text(),
	type: text(),
	action: text(),
	barrellength: text(),
	capacity: text(),
	finish: text(),
	overalllength: text(),
	receiver: text(),
	safety: text(),
	sights: text(),
	stockframegrips: text(),
	magazine: text(),
	weight: text(),
	imagename: text(),
	chamber: text(),
	drilledandtapped: text(),
	rateoftwist: text(),
	itemtype: text(),
	additionalfeature1: text(),
	additionalfeature2: text(),
	additionalfeature3: text(),
	shippingweight: text(),
	boundbookmanufacturer: text(),
	boundbookmodel: text(),
	boundbooktype: text(),
	nfathreadpattern: text(),
	nfaattachmentmethod: text(),
	nfabaffletype: text(),
	silencercanbedisassembled: text(),
	silencerconstructionmaterial: text(),
	nfadbreduction: text(),
	silenceroutsidediameter: text(),
	nfaform3Caliber: text(),
	opticmagnification: text(),
	maintubesize: text(),
	adjustableobjective: text(),
	objectivesize: text(),
	opticadjustments: text(),
	illuminatedreticle: text(),
	reticle: text(),
	exclusive: text(),
	quantity: varchar({ length: 10 }).default(sql`NULL`),
	allocated: text(),
	onsale: text(),
	price: doublePrecision(),
	currentprice: doublePrecision(),
	retailmap: doublePrecision(),
	fflrequired: text(),
	sotrequired: text(),
	exclusivetype: text(),
	scopecoverincluded: text(),
	special: text(),
	sightstype: text(),
	case: text(),
	choke: text(),
	dbreduction: text(),
	family: text(),
	finishtype: text(),
	frame: text(),
	griptype: varchar({ length: 30 }),
	handgunslidematerial: text(),
	countryoforigin: varchar({ length: 4 }),
	itemlength: text(),
	itemwidth: text(),
	itemheight: text(),
	packagelength: doublePrecision(),
	packagewidth: doublePrecision(),
	packageheight: doublePrecision(),
	itemgroup: varchar({ length: 40 }),
	...timestamps
});


