mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
db migration
This commit is contained in:
parent
224a8ad696
commit
e0449d01a2
4 changed files with 6451 additions and 0 deletions
2
src/app/db/migrations/0171_chunky_wallow.sql
Normal file
2
src/app/db/migrations/0171_chunky_wallow.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE "bulk_address_uploads" ADD COLUMN "source_headers" text[] DEFAULT '{}' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "bulk_address_uploads" ADD COLUMN "column_mapping" jsonb;
|
||||
6423
src/app/db/migrations/meta/0171_snapshot.json
Normal file
6423
src/app/db/migrations/meta/0171_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1198,6 +1198,13 @@
|
|||
"when": 1776357524564,
|
||||
"tag": "0170_furry_moonstone",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 171,
|
||||
"version": "7",
|
||||
"when": 1776361262258,
|
||||
"tag": "0171_chunky_wallow",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
19
src/app/db/schema/bulk_address_uploads.ts
Normal file
19
src/app/db/schema/bulk_address_uploads.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { pgTable, uuid, text, timestamp, jsonb } from "drizzle-orm/pg-core";
|
||||
import { sql } from "drizzle-orm";
|
||||
|
||||
export const bulkAddressUploads = pgTable("bulk_address_uploads", {
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
portfolioId: text("portfolio_id").notNull(),
|
||||
userId: text("user_id").notNull(),
|
||||
s3Bucket: text("s3_bucket").notNull(),
|
||||
s3Key: text("s3_key").notNull(),
|
||||
filename: text("filename").notNull(),
|
||||
status: text("status").notNull().default("ready_for_processing"),
|
||||
sourceHeaders: text("source_headers").array().notNull().default(sql`'{}'`),
|
||||
columnMapping: jsonb("column_mapping").$type<Record<string, string>>(),
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
||||
updatedAt: timestamp("updated_at", { withTimezone: true })
|
||||
.notNull()
|
||||
.defaultNow()
|
||||
.$onUpdate(() => new Date()),
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue