mirror of https://github.com/buster-so/buster.git
add a fix for broken migrate
This commit is contained in:
parent
62644bffeb
commit
43af5fdb4d
|
@ -1,5 +1,4 @@
|
||||||
import { Hono } from 'hono';
|
import { Hono } from 'hono';
|
||||||
import { requireAuth } from '../../../../middleware/auth';
|
|
||||||
import GET from './GET';
|
import GET from './GET';
|
||||||
import PUT from './PUT';
|
import PUT from './PUT';
|
||||||
import SHARING from './sharing';
|
import SHARING from './sharing';
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
ALTER TABLE "report_files" ADD CONSTRAINT "report_files_organization_id_fkey" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE no action ON UPDATE cascade;
|
||||||
|
|
||||||
|
ALTER TABLE "asset_search" ALTER COLUMN "asset_type" SET DATA TYPE text;--> statement-breakpoint
|
||||||
|
|
||||||
|
ALTER TABLE "dashboard_files" ALTER COLUMN "content" SET DEFAULT '[]'::jsonb;
|
File diff suppressed because it is too large
Load Diff
|
@ -610,6 +610,13 @@
|
||||||
"when": 1754342648525,
|
"when": 1754342648525,
|
||||||
"tag": "0086_report_table_enum_update",
|
"tag": "0086_report_table_enum_update",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 87,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1754359807604,
|
||||||
|
"tag": "0087_create_report_table_foreign_keys",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -38,6 +38,7 @@ export const assetTypeEnum = pgEnum('asset_type_enum', [
|
||||||
'dashboard_file',
|
'dashboard_file',
|
||||||
'report_file',
|
'report_file',
|
||||||
]);
|
]);
|
||||||
|
// Asset type enum removed - now using text for all asset_type columns
|
||||||
export const dataSourceOnboardingStatusEnum = pgEnum('data_source_onboarding_status_enum', [
|
export const dataSourceOnboardingStatusEnum = pgEnum('data_source_onboarding_status_enum', [
|
||||||
'notStarted',
|
'notStarted',
|
||||||
'inProgress',
|
'inProgress',
|
||||||
|
@ -470,7 +471,8 @@ export const assetSearch = pgTable(
|
||||||
{
|
{
|
||||||
id: uuid().defaultRandom().primaryKey().notNull(),
|
id: uuid().defaultRandom().primaryKey().notNull(),
|
||||||
assetId: uuid('asset_id').notNull(),
|
assetId: uuid('asset_id').notNull(),
|
||||||
assetType: assetTypeEnum('asset_type').notNull(),
|
// The assetType column is a plain string (text), not an enum.
|
||||||
|
assetType: text('asset_type').notNull(),
|
||||||
content: text().notNull(),
|
content: text().notNull(),
|
||||||
organizationId: uuid('organization_id').notNull(),
|
organizationId: uuid('organization_id').notNull(),
|
||||||
createdAt: timestamp('created_at', { withTimezone: true, mode: 'string' })
|
createdAt: timestamp('created_at', { withTimezone: true, mode: 'string' })
|
||||||
|
@ -932,7 +934,7 @@ export const dashboardFiles = pgTable(
|
||||||
id: uuid().defaultRandom().primaryKey().notNull(),
|
id: uuid().defaultRandom().primaryKey().notNull(),
|
||||||
name: varchar().notNull(),
|
name: varchar().notNull(),
|
||||||
fileName: varchar('file_name').notNull(),
|
fileName: varchar('file_name').notNull(),
|
||||||
content: jsonb().notNull(),
|
content: jsonb().notNull().default([]),
|
||||||
filter: varchar(),
|
filter: varchar(),
|
||||||
organizationId: uuid('organization_id').notNull(),
|
organizationId: uuid('organization_id').notNull(),
|
||||||
createdBy: uuid('created_by').notNull(),
|
createdBy: uuid('created_by').notNull(),
|
||||||
|
@ -1059,6 +1061,11 @@ export const reportFiles = pgTable(
|
||||||
foreignColumns: [users.id],
|
foreignColumns: [users.id],
|
||||||
name: 'report_files_workspace_sharing_enabled_by_fkey',
|
name: 'report_files_workspace_sharing_enabled_by_fkey',
|
||||||
}).onUpdate('cascade'),
|
}).onUpdate('cascade'),
|
||||||
|
foreignKey({
|
||||||
|
columns: [table.organizationId],
|
||||||
|
foreignColumns: [organizations.id],
|
||||||
|
name: 'report_files_organization_id_fkey',
|
||||||
|
}).onUpdate('cascade'),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"rootDir": "src"
|
"rootDir": "src"
|
||||||
},
|
},
|
||||||
"include": ["src/**/*", "env.d.ts"],
|
"include": ["src/**/*", "env.d.ts", "scripts/**/*"],
|
||||||
"exclude": ["node_modules", "dist", "tests", "**/*.test.ts", "**/*.spec.ts"],
|
"exclude": ["node_modules", "dist", "tests", "**/*.test.ts", "**/*.spec.ts"],
|
||||||
"references": [{ "path": "../vitest-config" }]
|
"references": [{ "path": "../vitest-config" }]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue