@coursebuilder/adapter-drizzle
Version:
Drizzle adapter for Course Builder.
63 lines (62 loc) • 2.52 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/communication/communication-channel.ts
var communication_channel_exports = {};
__export(communication_channel_exports, {
getCommunicationChannelSchema: () => getCommunicationChannelSchema
});
module.exports = __toCommonJS(communication_channel_exports);
var import_mysql_core = require("drizzle-orm/mysql-core");
function getCommunicationChannelSchema(mysqlTable) {
return mysqlTable("CommunicationChannel", {
id: (0, import_mysql_core.varchar)("id", {
length: 255
}).notNull().primaryKey(),
organizationId: (0, import_mysql_core.varchar)("organizationId", {
length: 191
}),
name: (0, import_mysql_core.varchar)("name", {
length: 255
}).notNull(),
description: (0, import_mysql_core.text)("description"),
active: (0, import_mysql_core.boolean)("active").notNull().default(true),
createdAt: (0, import_mysql_core.timestamp)("createdAt", {
mode: "date",
fsp: 3
}).defaultNow(),
updatedAt: (0, import_mysql_core.timestamp)("updatedAt", {
mode: "date",
fsp: 3
}).defaultNow(),
deletedAt: (0, import_mysql_core.timestamp)("deletedAt", {
mode: "date",
fsp: 3
})
}, (cc) => ({
nameIdx: (0, import_mysql_core.index)("name_idx").on(cc.name),
organizationIdIdx: (0, import_mysql_core.index)("organizationId_idx").on(cc.organizationId)
}));
}
__name(getCommunicationChannelSchema, "getCommunicationChannelSchema");
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getCommunicationChannelSchema
});
//# sourceMappingURL=communication-channel.cjs.map