mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +00:00
🗃️ finish db schemas for blueprints
This commit is contained in:
@@ -671,6 +671,17 @@ export const setupTokens = pgTable("setupTokens", {
|
|||||||
dateUsed: varchar("dateUsed")
|
dateUsed: varchar("dateUsed")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Blueprint runs
|
||||||
|
export const blueprints = pgTable("blueprints", {
|
||||||
|
blueprintId: serial("blueprintId").primaryKey(),
|
||||||
|
name: varchar("name").notNull(),
|
||||||
|
source: varchar("source"),
|
||||||
|
createdAt: integer("createdAt").notNull(),
|
||||||
|
succeeded: boolean("succeeded").notNull(),
|
||||||
|
contents: text("contents").notNull(),
|
||||||
|
message: text("message")
|
||||||
|
});
|
||||||
|
|
||||||
export type Org = InferSelectModel<typeof orgs>;
|
export type Org = InferSelectModel<typeof orgs>;
|
||||||
export type User = InferSelectModel<typeof users>;
|
export type User = InferSelectModel<typeof users>;
|
||||||
export type Site = InferSelectModel<typeof sites>;
|
export type Site = InferSelectModel<typeof sites>;
|
||||||
@@ -722,3 +733,4 @@ export type SetupToken = InferSelectModel<typeof setupTokens>;
|
|||||||
export type HostMeta = InferSelectModel<typeof hostMeta>;
|
export type HostMeta = InferSelectModel<typeof hostMeta>;
|
||||||
export type TargetHealthCheck = InferSelectModel<typeof targetHealthCheck>;
|
export type TargetHealthCheck = InferSelectModel<typeof targetHealthCheck>;
|
||||||
export type IdpOidcConfig = InferSelectModel<typeof idpOidcConfig>;
|
export type IdpOidcConfig = InferSelectModel<typeof idpOidcConfig>;
|
||||||
|
export type Blueprint = InferSelectModel<typeof blueprints>;
|
||||||
|
|||||||
@@ -717,13 +717,18 @@ export const idpOrg = sqliteTable("idpOrg", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Blueprint runs
|
// Blueprint runs
|
||||||
export const blueprintRuns = sqliteTable("blueprintRuns", {
|
export const blueprints = sqliteTable("blueprints", {
|
||||||
blueprintRunId: integer("blueprintRunId").primaryKey({
|
blueprintId: integer("blueprintId").primaryKey({
|
||||||
autoIncrement: true
|
autoIncrement: true
|
||||||
}),
|
}),
|
||||||
|
orgId: text("orgId")
|
||||||
|
.references(() => orgs.orgId, {
|
||||||
|
onDelete: "cascade"
|
||||||
|
})
|
||||||
|
.notNull(),
|
||||||
name: text("name").notNull(),
|
name: text("name").notNull(),
|
||||||
source: text("source", { enum: ["WEB", "CLI", "API"] }),
|
source: text("source"),
|
||||||
createdAt: integer("createdAt", { mode: "timestamp" }).notNull(),
|
createdAt: integer("createdAt").notNull(),
|
||||||
succeeded: integer("succeeded", { mode: "boolean" }).notNull(),
|
succeeded: integer("succeeded", { mode: "boolean" }).notNull(),
|
||||||
contents: text("contents").notNull(),
|
contents: text("contents").notNull(),
|
||||||
message: text("message")
|
message: text("message")
|
||||||
@@ -780,3 +785,4 @@ export type SetupToken = InferSelectModel<typeof setupTokens>;
|
|||||||
export type HostMeta = InferSelectModel<typeof hostMeta>;
|
export type HostMeta = InferSelectModel<typeof hostMeta>;
|
||||||
export type TargetHealthCheck = InferSelectModel<typeof targetHealthCheck>;
|
export type TargetHealthCheck = InferSelectModel<typeof targetHealthCheck>;
|
||||||
export type IdpOidcConfig = InferSelectModel<typeof idpOidcConfig>;
|
export type IdpOidcConfig = InferSelectModel<typeof idpOidcConfig>;
|
||||||
|
export type Blueprint = InferSelectModel<typeof blueprints>;
|
||||||
|
|||||||
Reference in New Issue
Block a user