fix: harden v2 custom widgets and Workshop (#6480)
This commit is contained in:
1 parent
e8a2c87c2d
commit
557ebe0a2f
138 files changed
+5151
-1976
No files matched your search
@@ -487,10 +487,10 @@ export const onboarding = sqliteTable("onboarding", {
|
||||
|
||||
/**
|
||||
* Read-only v1 definitions retained during the Custom JSX v2 upgrade.
|
||||
* They remain separate so legacy code can never execute in the v2 runtime.
|
||||
* Their original physical table names keep the database readable by a v1 binary.
|
||||
*/
|
||||
export const legacyCustomWidgetDefinitions = sqliteTable(
|
||||
"legacy_custom_widget_definition",
|
||||
"custom_widget_definition",
|
||||
{
|
||||
id: text().notNull().primaryKey(),
|
||||
name: text().notNull(),
|
||||
@@ -516,13 +516,13 @@ export const legacyCustomWidgetDefinitions = sqliteTable(
|
||||
creatorFk: foreignKey({
|
||||
columns: [table.creatorId],
|
||||
foreignColumns: [users.id],
|
||||
name: "legacy_cw_definition_creator_id_user_id_fk",
|
||||
name: "custom_widget_definition_creator_id_user_id_fk",
|
||||
}).onDelete("set null"),
|
||||
}),
|
||||
);
|
||||
|
||||
export const legacyCustomWidgetSecrets = sqliteTable(
|
||||
"legacy_custom_widget_secret",
|
||||
"custom_widget_secret",
|
||||
{
|
||||
kind: text().$type<CustomWidgetSecretKind>().notNull(),
|
||||
encryptedValue: text("value").$type<`${string}.${string}`>().notNull(),
|
||||
@@ -534,12 +534,12 @@ export const legacyCustomWidgetSecrets = sqliteTable(
|
||||
definitionFk: foreignKey({
|
||||
columns: [table.definitionId],
|
||||
foreignColumns: [legacyCustomWidgetDefinitions.id],
|
||||
name: "legacy_cw_secret_definition_id_fk",
|
||||
name: "custom_widget_secret_definition_id_custom_widget_definition_id_fk",
|
||||
}).onDelete("cascade"),
|
||||
}),
|
||||
);
|
||||
|
||||
export const customWidgetDefinitions = sqliteTable("custom_widget_definition", {
|
||||
export const customWidgetDefinitions = sqliteTable("custom_widget_v2_definition", {
|
||||
id: text().notNull().primaryKey(),
|
||||
name: text().notNull(),
|
||||
description: text(),
|
||||
@@ -559,7 +559,7 @@ export const customWidgetDefinitions = sqliteTable("custom_widget_definition", {
|
||||
});
|
||||
|
||||
export const customWidgetSecrets = sqliteTable(
|
||||
"custom_widget_secret",
|
||||
"custom_widget_v2_secret",
|
||||
{
|
||||
sourceId: text().notNull(),
|
||||
kind: text().$type<CustomWidgetSecretKind>().notNull(),
|
||||
@@ -576,7 +576,7 @@ export const customWidgetSecrets = sqliteTable(
|
||||
definitionFk: foreignKey({
|
||||
columns: [table.definitionId],
|
||||
foreignColumns: [customWidgetDefinitions.id],
|
||||
name: "cw_secret_definition_id_fk",
|
||||
name: "custom_widget_v2_secret_definition_id_fk",
|
||||
}).onDelete("cascade"),
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user