From 4f85646adeccc97274047331c9f6b06f8252d85c Mon Sep 17 00:00:00 2001 From: Timothy Yin Date: Tue, 10 Mar 2026 21:11:46 +0800 Subject: [PATCH] chore: update schema --- apps/csms/drizzle/0003_fluffy_morbius.sql | 3 +++ apps/csms/drizzle/meta/0003_snapshot.json | 31 ++++++++++++++++------- apps/csms/drizzle/meta/_journal.json | 7 +++++ 3 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 apps/csms/drizzle/0003_fluffy_morbius.sql diff --git a/apps/csms/drizzle/0003_fluffy_morbius.sql b/apps/csms/drizzle/0003_fluffy_morbius.sql new file mode 100644 index 0000000..9ec27d3 --- /dev/null +++ b/apps/csms/drizzle/0003_fluffy_morbius.sql @@ -0,0 +1,3 @@ +ALTER TABLE "id_tag" ALTER COLUMN "balance" SET DEFAULT 0;--> statement-breakpoint +ALTER TABLE "charge_point" ADD COLUMN "fee_per_kwh" integer DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE "transaction" ADD COLUMN "charge_amount" integer; \ No newline at end of file diff --git a/apps/csms/drizzle/meta/0003_snapshot.json b/apps/csms/drizzle/meta/0003_snapshot.json index 6f3724b..6748f84 100644 --- a/apps/csms/drizzle/meta/0003_snapshot.json +++ b/apps/csms/drizzle/meta/0003_snapshot.json @@ -1,6 +1,6 @@ { - "id": "7a1c94ab-46cd-48cb-b84f-622da7a036c1", - "prevId": "19bd6e2d-1648-4da6-a8db-4f66712febde", + "id": "625f31c4-cd87-4d4d-ad2b-22cf47de4295", + "prevId": "7a1c94ab-46cd-48cb-b84f-622da7a036c1", "version": "7", "dialect": "postgresql", "tables": { @@ -488,6 +488,13 @@ "primaryKey": false, "notNull": false }, + "fee_per_kwh": { + "name": "fee_per_kwh", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, "created_at": { "name": "created_at", "type": "timestamp with time zone", @@ -1020,6 +1027,13 @@ "primaryKey": false, "notNull": false }, + "balance": { + "name": "balance", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, "created_at": { "name": "created_at", "type": "timestamp with time zone", @@ -1033,13 +1047,6 @@ "primaryKey": false, "notNull": true, "default": "now()" - }, - "balance": { - "name": "balance", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": "0" } }, "indexes": {}, @@ -1535,6 +1542,12 @@ "primaryKey": false, "notNull": false }, + "charge_amount": { + "name": "charge_amount", + "type": "integer", + "primaryKey": false, + "notNull": false + }, "reservation_id": { "name": "reservation_id", "type": "integer", diff --git a/apps/csms/drizzle/meta/_journal.json b/apps/csms/drizzle/meta/_journal.json index 1a4c849..4efc3f3 100644 --- a/apps/csms/drizzle/meta/_journal.json +++ b/apps/csms/drizzle/meta/_journal.json @@ -22,6 +22,13 @@ "when": 1773109529038, "tag": "0002_melodic_moondragon", "breakpoints": true + }, + { + "idx": 3, + "version": "7", + "when": 1773148285424, + "tag": "0003_fluffy_morbius", + "breakpoints": true } ] } \ No newline at end of file