@coursebuilder/adapter-drizzle
Version:
Drizzle adapter for Course Builder.
70 lines (69 loc) • 2.81 kB
JavaScript
;
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-customer.ts
var merchant_customer_exports = {};
__export(merchant_customer_exports, {
getMerchantCustomerSchema: () => getMerchantCustomerSchema
});
module.exports = __toCommonJS(merchant_customer_exports);
var import_drizzle_orm = require("drizzle-orm");
var import_mysql_core = require("drizzle-orm/mysql-core");
function getMerchantCustomerSchema(mysqlTable) {
return mysqlTable("MerchantCustomer", {
id: (0, import_mysql_core.varchar)("id", {
length: 191
}).notNull(),
organizationId: (0, import_mysql_core.varchar)("organizationId", {
length: 191
}),
userId: (0, import_mysql_core.varchar)("userId", {
length: 191
}).notNull(),
merchantAccountId: (0, import_mysql_core.varchar)("merchantAccountId", {
length: 191
}).notNull(),
identifier: (0, import_mysql_core.varchar)("identifier", {
length: 191
}).notNull(),
createdAt: (0, import_mysql_core.timestamp)("createdAt", {
mode: "date",
fsp: 3
}).default(import_drizzle_orm.sql`CURRENT_TIMESTAMP(3)`).notNull(),
status: (0, import_mysql_core.int)("status").default(0)
}, (table) => {
return {
merchantCustomerId: (0, import_mysql_core.primaryKey)({
columns: [
table.id
],
name: "MerchantCustomer_id"
}),
merchantCustomerIdentifierKey: (0, import_mysql_core.unique)("MerchantCustomer_identifier_key").on(table.identifier),
userIdIdx: (0, import_mysql_core.index)("idx_MerchantCustomer_on_userId").on(table.userId),
organizationIdIdx: (0, import_mysql_core.index)("organizationId_idx").on(table.organizationId)
};
});
}
__name(getMerchantCustomerSchema, "getMerchantCustomerSchema");
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getMerchantCustomerSchema
});
//# sourceMappingURL=merchant-customer.cjs.map