feat: add module migration contracts and validation
This commit is contained in:
@@ -1,12 +1,7 @@
|
||||
import { createModuleTable, defineModuleSchema } from "@ekklesia/module-sdk";
|
||||
import { text, uuid } from "drizzle-orm/pg-core";
|
||||
import { defineModuleSchema } from "@ekklesia/module-sdk";
|
||||
import { records } from "./tables.js";
|
||||
|
||||
const moduleTable = createModuleTable("example");
|
||||
|
||||
export const records = moduleTable("records", {
|
||||
id: uuid("id").primaryKey(),
|
||||
value: text("value").notNull(),
|
||||
});
|
||||
export { records } from "./tables.js";
|
||||
|
||||
export default defineModuleSchema({
|
||||
moduleId: "example",
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { pgTableCreator, text, uuid } from "drizzle-orm/pg-core";
|
||||
|
||||
const moduleTable = pgTableCreator((localName) => `example_${localName}`);
|
||||
|
||||
export const records = moduleTable("records", {
|
||||
id: uuid("id").primaryKey(),
|
||||
value: text("value").notNull(),
|
||||
});
|
||||
Reference in New Issue
Block a user