UNPKG

@coursebuilder/adapter-drizzle

Version:

Drizzle adapter for Course Builder.

69 lines (68 loc) 2.7 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/lib/mysql/schemas/commerce/merchant-product.ts var merchant_product_exports = {}; __export(merchant_product_exports, { getMerchantProductSchema: () => getMerchantProductSchema }); module.exports = __toCommonJS(merchant_product_exports); var import_drizzle_orm = require("drizzle-orm"); var import_mysql_core = require("drizzle-orm/mysql-core"); function getMerchantProductSchema(mysqlTable) { return mysqlTable("MerchantProduct", { id: (0, import_mysql_core.varchar)("id", { length: 191 }).notNull(), organizationId: (0, import_mysql_core.varchar)("organizationId", { length: 191 }), merchantAccountId: (0, import_mysql_core.varchar)("merchantAccountId", { length: 191 }).notNull(), productId: (0, import_mysql_core.varchar)("productId", { length: 191 }).notNull(), status: (0, import_mysql_core.int)("status").default(0).notNull(), identifier: (0, import_mysql_core.varchar)("identifier", { length: 191 }), createdAt: (0, import_mysql_core.timestamp)("createdAt", { mode: "date", fsp: 3 }).default(import_drizzle_orm.sql`CURRENT_TIMESTAMP(3)`).notNull() }, (table) => { return { merchantProductId: (0, import_mysql_core.primaryKey)({ columns: [ table.id ], name: "MerchantProduct_id" }), merchantProductIdentifierKey: (0, import_mysql_core.unique)("MerchantProduct_identifier_key").on(table.identifier), organizationIdIdx: (0, import_mysql_core.index)("organizationId_idx").on(table.organizationId) }; }); } __name(getMerchantProductSchema, "getMerchantProductSchema"); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { getMerchantProductSchema }); //# sourceMappingURL=merchant-product.cjs.map