new migration files

This commit is contained in:
Daniel Roth 2026-06-03 12:55:49 +00:00
parent fb952a6716
commit 2011847aa7
7 changed files with 11 additions and 13 deletions

1
migrate_to_db.sh Normal file
View file

@ -0,0 +1 @@
npx drizzle-kit migrate

View file

@ -0,0 +1,5 @@
set -ex
for f in src/app/db/migrations/*.sql; do
hash=$(sha256sum "$f" | awk '{print $1}')
echo "INSERT INTO __drizzle_migrations (hash, created_at) SELECT '$hash', extract(epoch from now())::bigint * 1000 WHERE NOT EXISTS (SELECT 1 FROM __drizzle_migrations WHERE hash = '$hash');"
done

View file

@ -12,7 +12,7 @@
"test:e2e:open": "start-server-and-test dev http://localhost:3000 \"cypress open --e2e\"",
"test:e2e:run": "cypress run",
"migration:generate": "drizzle-kit generate",
"migration:push": "drizzle-kit push",
"migration:migrate": "drizzle-kit migrate",
"create_user": "tsx src/app/db/create_user.ts"
},
"dependencies": {

View file

@ -1 +0,0 @@
npx drizzle-kit push

View file

@ -1,5 +1,5 @@
CREATE TYPE "public"."rebaseline_reason" AS ENUM('none', 'pre_sap10', 'physical_state_changed', 'both');--> statement-breakpoint
ALTER TYPE "public"."file_type" ADD VALUE 'other';--> statement-breakpoint
ALTER TYPE "public"."file_type" ADD VALUE IF NOT EXISTS 'other';--> statement-breakpoint
CREATE TABLE "epc_renewable_heat_incentive" (
"id" bigserial PRIMARY KEY NOT NULL,
"epc_property_id" bigint NOT NULL,

View file

@ -1,5 +1,5 @@
{
"id": "2e1be8b1-cd76-4951-9e53-f4e21e4ccec1",
"id": "4b32b79f-ba72-4512-9214-9335d7f1239c",
"prevId": "07dbe008-1c2a-4d52-b27a-74f9e68fa596",
"version": "7",
"dialect": "postgresql",

View file

@ -1255,13 +1255,6 @@
"tag": "0178_parched_midnight",
"breakpoints": true
},
{
"idx": 179,
"version": "7",
"when": 1776459924335,
"tag": "0179_mighty_cardiac",
"breakpoints": true
},
{
"idx": 180,
"version": "7",
@ -1545,8 +1538,8 @@
{
"idx": 220,
"version": "7",
"when": 1780483404142,
"tag": "0220_glamorous_phantom_reporter",
"when": 1780491109956,
"tag": "0220_round_retro_girl",
"breakpoints": true
}
]