From fc18332cd593ab2a2159d515d9107417259d799e Mon Sep 17 00:00:00 2001 From: Timothy Yin Date: Tue, 10 Mar 2026 21:20:20 +0800 Subject: [PATCH] refactor(csms): regenerate schema files --- ...oondragon.sql => 0000_last_big_bertha.sql} | 66 +- apps/csms/drizzle/0000_real_garia.sql | 51 - .../drizzle/0001_gorgeous_invisible_woman.sql | 3 - apps/csms/drizzle/0003_fluffy_morbius.sql | 3 - apps/csms/drizzle/meta/0000_snapshot.json | 1351 ++++++++++++- apps/csms/drizzle/meta/0001_snapshot.json | 352 ---- apps/csms/drizzle/meta/0002_snapshot.json | 1660 ---------------- apps/csms/drizzle/meta/0003_snapshot.json | 1680 ----------------- apps/csms/drizzle/meta/_journal.json | 25 +- 9 files changed, 1412 insertions(+), 3779 deletions(-) rename apps/csms/drizzle/{0002_melodic_moondragon.sql => 0000_last_big_bertha.sql} (83%) delete mode 100644 apps/csms/drizzle/0000_real_garia.sql delete mode 100644 apps/csms/drizzle/0001_gorgeous_invisible_woman.sql delete mode 100644 apps/csms/drizzle/0003_fluffy_morbius.sql delete mode 100644 apps/csms/drizzle/meta/0001_snapshot.json delete mode 100644 apps/csms/drizzle/meta/0002_snapshot.json delete mode 100644 apps/csms/drizzle/meta/0003_snapshot.json diff --git a/apps/csms/drizzle/0002_melodic_moondragon.sql b/apps/csms/drizzle/0000_last_big_bertha.sql similarity index 83% rename from apps/csms/drizzle/0002_melodic_moondragon.sql rename to apps/csms/drizzle/0000_last_big_bertha.sql index 602f386..c55154e 100644 --- a/apps/csms/drizzle/0002_melodic_moondragon.sql +++ b/apps/csms/drizzle/0000_last_big_bertha.sql @@ -1,3 +1,19 @@ +CREATE TABLE "account" ( + "id" text PRIMARY KEY NOT NULL, + "account_id" text NOT NULL, + "provider_id" text NOT NULL, + "user_id" text NOT NULL, + "access_token" text, + "refresh_token" text, + "id_token" text, + "access_token_expires_at" timestamp, + "refresh_token_expires_at" timestamp, + "scope" text, + "password" text, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp NOT NULL +); +--> statement-breakpoint CREATE TABLE "jwks" ( "id" text PRIMARY KEY NOT NULL, "public_key" text NOT NULL, @@ -5,6 +21,46 @@ CREATE TABLE "jwks" ( "created_at" timestamp NOT NULL ); --> statement-breakpoint +CREATE TABLE "session" ( + "id" text PRIMARY KEY NOT NULL, + "expires_at" timestamp NOT NULL, + "token" text NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp NOT NULL, + "ip_address" text, + "user_agent" text, + "user_id" text NOT NULL, + "impersonated_by" text, + CONSTRAINT "session_token_unique" UNIQUE("token") +); +--> statement-breakpoint +CREATE TABLE "user" ( + "id" text PRIMARY KEY NOT NULL, + "name" text NOT NULL, + "email" text NOT NULL, + "email_verified" boolean DEFAULT false NOT NULL, + "image" text, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + "role" text, + "banned" boolean DEFAULT false, + "ban_reason" text, + "ban_expires" timestamp, + "username" text, + "display_username" text, + CONSTRAINT "user_email_unique" UNIQUE("email"), + CONSTRAINT "user_username_unique" UNIQUE("username") +); +--> statement-breakpoint +CREATE TABLE "verification" ( + "id" text PRIMARY KEY NOT NULL, + "identifier" text NOT NULL, + "value" text NOT NULL, + "expires_at" timestamp NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint CREATE TABLE "charge_point" ( "id" varchar PRIMARY KEY NOT NULL, "charge_point_identifier" varchar(255) NOT NULL, @@ -20,6 +76,7 @@ CREATE TABLE "charge_point" ( "heartbeat_interval" integer DEFAULT 60, "last_heartbeat_at" timestamp with time zone, "last_boot_notification_at" timestamp with time zone, + "fee_per_kwh" integer DEFAULT 0 NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "charge_point_charge_point_identifier_unique" UNIQUE("charge_point_identifier") @@ -75,6 +132,7 @@ CREATE TABLE "id_tag" ( "status" varchar DEFAULT 'Accepted' NOT NULL, "expiry_date" timestamp with time zone, "user_id" text, + "balance" integer DEFAULT 0 NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL ); @@ -127,16 +185,14 @@ CREATE TABLE "transaction" ( "stop_timestamp" timestamp with time zone, "stop_meter_value" integer, "stop_reason" varchar, + "charge_amount" integer, "reservation_id" integer, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL ); --> statement-breakpoint -ALTER TABLE "user" ALTER COLUMN "role" DROP DEFAULT;--> statement-breakpoint -ALTER TABLE "session" ADD COLUMN "impersonated_by" text;--> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "banned" boolean DEFAULT false;--> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "ban_reason" text;--> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "ban_expires" timestamp;--> statement-breakpoint +ALTER TABLE "account" ADD CONSTRAINT "account_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "session" ADD CONSTRAINT "session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint ALTER TABLE "charging_profile" ADD CONSTRAINT "charging_profile_charge_point_id_charge_point_id_fk" FOREIGN KEY ("charge_point_id") REFERENCES "public"."charge_point"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint ALTER TABLE "charging_profile" ADD CONSTRAINT "charging_profile_connector_id_connector_id_fk" FOREIGN KEY ("connector_id") REFERENCES "public"."connector"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint ALTER TABLE "charging_profile" ADD CONSTRAINT "charging_profile_transaction_id_transaction_id_fk" FOREIGN KEY ("transaction_id") REFERENCES "public"."transaction"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint diff --git a/apps/csms/drizzle/0000_real_garia.sql b/apps/csms/drizzle/0000_real_garia.sql deleted file mode 100644 index 1e592ec..0000000 --- a/apps/csms/drizzle/0000_real_garia.sql +++ /dev/null @@ -1,51 +0,0 @@ -CREATE TABLE "account" ( - "id" text PRIMARY KEY NOT NULL, - "account_id" text NOT NULL, - "provider_id" text NOT NULL, - "user_id" text NOT NULL, - "access_token" text, - "refresh_token" text, - "id_token" text, - "access_token_expires_at" timestamp, - "refresh_token_expires_at" timestamp, - "scope" text, - "password" text, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp NOT NULL -); ---> statement-breakpoint -CREATE TABLE "session" ( - "id" text PRIMARY KEY NOT NULL, - "expires_at" timestamp NOT NULL, - "token" text NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp NOT NULL, - "ip_address" text, - "user_agent" text, - "user_id" text NOT NULL, - CONSTRAINT "session_token_unique" UNIQUE("token") -); ---> statement-breakpoint -CREATE TABLE "user" ( - "id" text PRIMARY KEY NOT NULL, - "name" text NOT NULL, - "email" text NOT NULL, - "email_verified" boolean DEFAULT false NOT NULL, - "image" text, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, - "role" text DEFAULT 'user', - CONSTRAINT "user_email_unique" UNIQUE("email") -); ---> statement-breakpoint -CREATE TABLE "verification" ( - "id" text PRIMARY KEY NOT NULL, - "identifier" text NOT NULL, - "value" text NOT NULL, - "expires_at" timestamp NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL -); ---> statement-breakpoint -ALTER TABLE "account" ADD CONSTRAINT "account_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "session" ADD CONSTRAINT "session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action; \ No newline at end of file diff --git a/apps/csms/drizzle/0001_gorgeous_invisible_woman.sql b/apps/csms/drizzle/0001_gorgeous_invisible_woman.sql deleted file mode 100644 index 122ae10..0000000 --- a/apps/csms/drizzle/0001_gorgeous_invisible_woman.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE "user" ADD COLUMN "username" text;--> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "display_username" text;--> statement-breakpoint -ALTER TABLE "user" ADD CONSTRAINT "user_username_unique" UNIQUE("username"); \ No newline at end of file diff --git a/apps/csms/drizzle/0003_fluffy_morbius.sql b/apps/csms/drizzle/0003_fluffy_morbius.sql deleted file mode 100644 index 9ec27d3..0000000 --- a/apps/csms/drizzle/0003_fluffy_morbius.sql +++ /dev/null @@ -1,3 +0,0 @@ -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/0000_snapshot.json b/apps/csms/drizzle/meta/0000_snapshot.json index f19c4fc..fdf2cb3 100644 --- a/apps/csms/drizzle/meta/0000_snapshot.json +++ b/apps/csms/drizzle/meta/0000_snapshot.json @@ -1,5 +1,5 @@ { - "id": "a406c0d9-3511-445d-a09c-aa5a409730d7", + "id": "6b92f83e-6808-4773-b02d-0959316c548f", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", @@ -110,6 +110,43 @@ "checkConstraints": {}, "isRLSEnabled": false }, + "public.jwks": { + "name": "jwks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "public_key": { + "name": "public_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "private_key": { + "name": "private_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, "public.session": { "name": "session", "schema": "", @@ -162,6 +199,12 @@ "type": "text", "primaryKey": false, "notNull": true + }, + "impersonated_by": { + "name": "impersonated_by", + "type": "text", + "primaryKey": false, + "notNull": false } }, "indexes": {}, @@ -247,8 +290,38 @@ "name": "role", "type": "text", "primaryKey": false, + "notNull": false + }, + "banned": { + "name": "banned", + "type": "boolean", + "primaryKey": false, "notNull": false, - "default": "'user'" + "default": false + }, + "ban_reason": { + "name": "ban_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ban_expires": { + "name": "ban_expires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "display_username": { + "name": "display_username", + "type": "text", + "primaryKey": false, + "notNull": false } }, "indexes": {}, @@ -261,6 +334,13 @@ "columns": [ "email" ] + }, + "user_username_unique": { + "name": "user_username_unique", + "nullsNotDistinct": false, + "columns": [ + "username" + ] } }, "policies": {}, @@ -317,6 +397,1273 @@ "policies": {}, "checkConstraints": {}, "isRLSEnabled": false + }, + "public.charge_point": { + "name": "charge_point", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "charge_point_identifier": { + "name": "charge_point_identifier", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "charge_point_serial_number": { + "name": "charge_point_serial_number", + "type": "varchar(25)", + "primaryKey": false, + "notNull": false + }, + "charge_point_model": { + "name": "charge_point_model", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "charge_point_vendor": { + "name": "charge_point_vendor", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "firmware_version": { + "name": "firmware_version", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "iccid": { + "name": "iccid", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "imsi": { + "name": "imsi", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "meter_serial_number": { + "name": "meter_serial_number", + "type": "varchar(25)", + "primaryKey": false, + "notNull": false + }, + "meter_type": { + "name": "meter_type", + "type": "varchar(25)", + "primaryKey": false, + "notNull": false + }, + "registration_status": { + "name": "registration_status", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'Pending'" + }, + "heartbeat_interval": { + "name": "heartbeat_interval", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 60 + }, + "last_heartbeat_at": { + "name": "last_heartbeat_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_boot_notification_at": { + "name": "last_boot_notification_at", + "type": "timestamp with time zone", + "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", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "charge_point_charge_point_identifier_unique": { + "name": "charge_point_charge_point_identifier_unique", + "nullsNotDistinct": false, + "columns": [ + "charge_point_identifier" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.charging_profile": { + "name": "charging_profile", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "charge_point_id": { + "name": "charge_point_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "connector_number": { + "name": "connector_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "transaction_id": { + "name": "transaction_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "stack_level": { + "name": "stack_level", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "charging_profile_purpose": { + "name": "charging_profile_purpose", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "charging_profile_kind": { + "name": "charging_profile_kind", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "recurrency_kind": { + "name": "recurrency_kind", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "valid_from": { + "name": "valid_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "valid_to": { + "name": "valid_to", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "charging_schedule": { + "name": "charging_schedule", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_charging_profile_charge_point_id": { + "name": "idx_charging_profile_charge_point_id", + "columns": [ + { + "expression": "charge_point_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_charging_profile_connector_id": { + "name": "idx_charging_profile_connector_id", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_charging_profile_purpose_stack": { + "name": "idx_charging_profile_purpose_stack", + "columns": [ + { + "expression": "connector_number", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "charging_profile_purpose", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "stack_level", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "charging_profile_charge_point_id_charge_point_id_fk": { + "name": "charging_profile_charge_point_id_charge_point_id_fk", + "tableFrom": "charging_profile", + "tableTo": "charge_point", + "columnsFrom": [ + "charge_point_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "charging_profile_connector_id_connector_id_fk": { + "name": "charging_profile_connector_id_connector_id_fk", + "tableFrom": "charging_profile", + "tableTo": "connector", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "charging_profile_transaction_id_transaction_id_fk": { + "name": "charging_profile_transaction_id_transaction_id_fk", + "tableFrom": "charging_profile", + "tableTo": "transaction", + "columnsFrom": [ + "transaction_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.connector": { + "name": "connector", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "charge_point_id": { + "name": "charge_point_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'Unavailable'" + }, + "error_code": { + "name": "error_code", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'NoError'" + }, + "info": { + "name": "info", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "vendor_id": { + "name": "vendor_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "vendor_error_code": { + "name": "vendor_error_code", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "last_status_at": { + "name": "last_status_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_connector_charge_point_id": { + "name": "idx_connector_charge_point_id", + "columns": [ + { + "expression": "charge_point_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_connector_charge_point_connector": { + "name": "idx_connector_charge_point_connector", + "columns": [ + { + "expression": "charge_point_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "connector_charge_point_id_charge_point_id_fk": { + "name": "connector_charge_point_id_charge_point_id_fk", + "tableFrom": "connector", + "tableTo": "charge_point", + "columnsFrom": [ + "charge_point_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.connector_status_history": { + "name": "connector_status_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "connector_number": { + "name": "connector_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "error_code": { + "name": "error_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "info": { + "name": "info", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "vendor_id": { + "name": "vendor_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "vendor_error_code": { + "name": "vendor_error_code", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "status_timestamp": { + "name": "status_timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "received_at": { + "name": "received_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_status_history_connector_id": { + "name": "idx_status_history_connector_id", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_status_history_timestamp": { + "name": "idx_status_history_timestamp", + "columns": [ + { + "expression": "status_timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_status_history_received_at": { + "name": "idx_status_history_received_at", + "columns": [ + { + "expression": "received_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "connector_status_history_connector_id_connector_id_fk": { + "name": "connector_status_history_connector_id_connector_id_fk", + "tableFrom": "connector_status_history", + "tableTo": "connector", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.id_tag": { + "name": "id_tag", + "schema": "", + "columns": { + "id_tag": { + "name": "id_tag", + "type": "varchar(20)", + "primaryKey": true, + "notNull": true + }, + "parent_id_tag": { + "name": "parent_id_tag", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'Accepted'" + }, + "expiry_date": { + "name": "expiry_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "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", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "id_tag_user_id_user_id_fk": { + "name": "id_tag_user_id_user_id_fk", + "tableFrom": "id_tag", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.local_auth_list": { + "name": "local_auth_list", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "charge_point_id": { + "name": "charge_point_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "list_version": { + "name": "list_version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id_tag": { + "name": "id_tag", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "parent_id_tag": { + "name": "parent_id_tag", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "id_tag_status": { + "name": "id_tag_status", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "expiry_date": { + "name": "expiry_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_local_auth_list_charge_point_id_tag": { + "name": "idx_local_auth_list_charge_point_id_tag", + "columns": [ + { + "expression": "charge_point_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id_tag", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "local_auth_list_charge_point_id_charge_point_id_fk": { + "name": "local_auth_list_charge_point_id_charge_point_id_fk", + "tableFrom": "local_auth_list", + "tableTo": "charge_point", + "columnsFrom": [ + "charge_point_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.meter_value": { + "name": "meter_value", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "transaction_id": { + "name": "transaction_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "connector_id": { + "name": "connector_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "charge_point_id": { + "name": "charge_point_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "connector_number": { + "name": "connector_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "sampled_values": { + "name": "sampled_values", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "received_at": { + "name": "received_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_meter_value_transaction_id": { + "name": "idx_meter_value_transaction_id", + "columns": [ + { + "expression": "transaction_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_meter_value_connector_id": { + "name": "idx_meter_value_connector_id", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_meter_value_timestamp": { + "name": "idx_meter_value_timestamp", + "columns": [ + { + "expression": "timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "meter_value_transaction_id_transaction_id_fk": { + "name": "meter_value_transaction_id_transaction_id_fk", + "tableFrom": "meter_value", + "tableTo": "transaction", + "columnsFrom": [ + "transaction_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "meter_value_connector_id_connector_id_fk": { + "name": "meter_value_connector_id_connector_id_fk", + "tableFrom": "meter_value", + "tableTo": "connector", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "meter_value_charge_point_id_charge_point_id_fk": { + "name": "meter_value_charge_point_id_charge_point_id_fk", + "tableFrom": "meter_value", + "tableTo": "charge_point", + "columnsFrom": [ + "charge_point_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.reservation": { + "name": "reservation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "charge_point_id": { + "name": "charge_point_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "connector_number": { + "name": "connector_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "expiry_date": { + "name": "expiry_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "id_tag": { + "name": "id_tag", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "parent_id_tag": { + "name": "parent_id_tag", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'Active'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_reservation_charge_point_id": { + "name": "idx_reservation_charge_point_id", + "columns": [ + { + "expression": "charge_point_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_reservation_status": { + "name": "idx_reservation_status", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_reservation_expiry_date": { + "name": "idx_reservation_expiry_date", + "columns": [ + { + "expression": "expiry_date", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "reservation_charge_point_id_charge_point_id_fk": { + "name": "reservation_charge_point_id_charge_point_id_fk", + "tableFrom": "reservation", + "tableTo": "charge_point", + "columnsFrom": [ + "charge_point_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "reservation_connector_id_connector_id_fk": { + "name": "reservation_connector_id_connector_id_fk", + "tableFrom": "reservation", + "tableTo": "connector", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.transaction": { + "name": "transaction", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "charge_point_id": { + "name": "charge_point_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "connector_number": { + "name": "connector_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id_tag": { + "name": "id_tag", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "id_tag_status": { + "name": "id_tag_status", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "start_timestamp": { + "name": "start_timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "start_meter_value": { + "name": "start_meter_value", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "stop_id_tag": { + "name": "stop_id_tag", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "stop_timestamp": { + "name": "stop_timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "stop_meter_value": { + "name": "stop_meter_value", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "stop_reason": { + "name": "stop_reason", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "charge_amount": { + "name": "charge_amount", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "reservation_id": { + "name": "reservation_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_transaction_charge_point_id": { + "name": "idx_transaction_charge_point_id", + "columns": [ + { + "expression": "charge_point_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_transaction_connector_id": { + "name": "idx_transaction_connector_id", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_transaction_id_tag": { + "name": "idx_transaction_id_tag", + "columns": [ + { + "expression": "id_tag", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_transaction_start_timestamp": { + "name": "idx_transaction_start_timestamp", + "columns": [ + { + "expression": "start_timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "transaction_charge_point_id_charge_point_id_fk": { + "name": "transaction_charge_point_id_charge_point_id_fk", + "tableFrom": "transaction", + "tableTo": "charge_point", + "columnsFrom": [ + "charge_point_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "transaction_connector_id_connector_id_fk": { + "name": "transaction_connector_id_connector_id_fk", + "tableFrom": "transaction", + "tableTo": "connector", + "columnsFrom": [ + "connector_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false } }, "enums": {}, diff --git a/apps/csms/drizzle/meta/0001_snapshot.json b/apps/csms/drizzle/meta/0001_snapshot.json deleted file mode 100644 index 80a03cf..0000000 --- a/apps/csms/drizzle/meta/0001_snapshot.json +++ /dev/null @@ -1,352 +0,0 @@ -{ - "id": "0f080c45-a0f2-44c8-ad7b-9587335710d8", - "prevId": "a406c0d9-3511-445d-a09c-aa5a409730d7", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "account_id": { - "name": "account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_id": { - "name": "provider_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token_expires_at": { - "name": "access_token_expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "refresh_token_expires_at": { - "name": "refresh_token_expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "ip_address": { - "name": "ip_address", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_agent": { - "name": "user_agent", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "session_token_unique": { - "name": "session_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "display_username": { - "name": "display_username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_username_unique": { - "name": "user_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.verification": { - "name": "verification", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/csms/drizzle/meta/0002_snapshot.json b/apps/csms/drizzle/meta/0002_snapshot.json deleted file mode 100644 index 8d56949..0000000 --- a/apps/csms/drizzle/meta/0002_snapshot.json +++ /dev/null @@ -1,1660 +0,0 @@ -{ - "id": "19bd6e2d-1648-4da6-a8db-4f66712febde", - "prevId": "0f080c45-a0f2-44c8-ad7b-9587335710d8", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "account_id": { - "name": "account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_id": { - "name": "provider_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token_expires_at": { - "name": "access_token_expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "refresh_token_expires_at": { - "name": "refresh_token_expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.jwks": { - "name": "jwks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "ip_address": { - "name": "ip_address", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_agent": { - "name": "user_agent", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "impersonated_by": { - "name": "impersonated_by", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "session_token_unique": { - "name": "session_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "ban_reason": { - "name": "ban_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ban_expires": { - "name": "ban_expires", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "display_username": { - "name": "display_username", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_username_unique": { - "name": "user_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.verification": { - "name": "verification", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.charge_point": { - "name": "charge_point", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "charge_point_identifier": { - "name": "charge_point_identifier", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "charge_point_serial_number": { - "name": "charge_point_serial_number", - "type": "varchar(25)", - "primaryKey": false, - "notNull": false - }, - "charge_point_model": { - "name": "charge_point_model", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true - }, - "charge_point_vendor": { - "name": "charge_point_vendor", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true - }, - "firmware_version": { - "name": "firmware_version", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "iccid": { - "name": "iccid", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "imsi": { - "name": "imsi", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "meter_serial_number": { - "name": "meter_serial_number", - "type": "varchar(25)", - "primaryKey": false, - "notNull": false - }, - "meter_type": { - "name": "meter_type", - "type": "varchar(25)", - "primaryKey": false, - "notNull": false - }, - "registration_status": { - "name": "registration_status", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'Pending'" - }, - "heartbeat_interval": { - "name": "heartbeat_interval", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 60 - }, - "last_heartbeat_at": { - "name": "last_heartbeat_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_boot_notification_at": { - "name": "last_boot_notification_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "charge_point_charge_point_identifier_unique": { - "name": "charge_point_charge_point_identifier_unique", - "nullsNotDistinct": false, - "columns": [ - "charge_point_identifier" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.charging_profile": { - "name": "charging_profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_id": { - "name": "connector_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "connector_number": { - "name": "connector_number", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "transaction_id": { - "name": "transaction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "stack_level": { - "name": "stack_level", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "charging_profile_purpose": { - "name": "charging_profile_purpose", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "charging_profile_kind": { - "name": "charging_profile_kind", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "recurrency_kind": { - "name": "recurrency_kind", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "charging_schedule": { - "name": "charging_schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_charging_profile_charge_point_id": { - "name": "idx_charging_profile_charge_point_id", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_charging_profile_connector_id": { - "name": "idx_charging_profile_connector_id", - "columns": [ - { - "expression": "connector_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_charging_profile_purpose_stack": { - "name": "idx_charging_profile_purpose_stack", - "columns": [ - { - "expression": "connector_number", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "charging_profile_purpose", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "stack_level", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "charging_profile_charge_point_id_charge_point_id_fk": { - "name": "charging_profile_charge_point_id_charge_point_id_fk", - "tableFrom": "charging_profile", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "charging_profile_connector_id_connector_id_fk": { - "name": "charging_profile_connector_id_connector_id_fk", - "tableFrom": "charging_profile", - "tableTo": "connector", - "columnsFrom": [ - "connector_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "charging_profile_transaction_id_transaction_id_fk": { - "name": "charging_profile_transaction_id_transaction_id_fk", - "tableFrom": "charging_profile", - "tableTo": "transaction", - "columnsFrom": [ - "transaction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.connector": { - "name": "connector", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_id": { - "name": "connector_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'Unavailable'" - }, - "error_code": { - "name": "error_code", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'NoError'" - }, - "info": { - "name": "info", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "vendor_id": { - "name": "vendor_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "vendor_error_code": { - "name": "vendor_error_code", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "last_status_at": { - "name": "last_status_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_connector_charge_point_id": { - "name": "idx_connector_charge_point_id", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_connector_charge_point_connector": { - "name": "idx_connector_charge_point_connector", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "connector_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "connector_charge_point_id_charge_point_id_fk": { - "name": "connector_charge_point_id_charge_point_id_fk", - "tableFrom": "connector", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.connector_status_history": { - "name": "connector_status_history", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "connector_id": { - "name": "connector_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_number": { - "name": "connector_number", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "error_code": { - "name": "error_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "info": { - "name": "info", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "vendor_id": { - "name": "vendor_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "vendor_error_code": { - "name": "vendor_error_code", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "status_timestamp": { - "name": "status_timestamp", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "received_at": { - "name": "received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_status_history_connector_id": { - "name": "idx_status_history_connector_id", - "columns": [ - { - "expression": "connector_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_status_history_timestamp": { - "name": "idx_status_history_timestamp", - "columns": [ - { - "expression": "status_timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_status_history_received_at": { - "name": "idx_status_history_received_at", - "columns": [ - { - "expression": "received_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "connector_status_history_connector_id_connector_id_fk": { - "name": "connector_status_history_connector_id_connector_id_fk", - "tableFrom": "connector_status_history", - "tableTo": "connector", - "columnsFrom": [ - "connector_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.id_tag": { - "name": "id_tag", - "schema": "", - "columns": { - "id_tag": { - "name": "id_tag", - "type": "varchar(20)", - "primaryKey": true, - "notNull": true - }, - "parent_id_tag": { - "name": "parent_id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'Accepted'" - }, - "expiry_date": { - "name": "expiry_date", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "id_tag_user_id_user_id_fk": { - "name": "id_tag_user_id_user_id_fk", - "tableFrom": "id_tag", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.local_auth_list": { - "name": "local_auth_list", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "list_version": { - "name": "list_version", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "id_tag": { - "name": "id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true - }, - "parent_id_tag": { - "name": "parent_id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "id_tag_status": { - "name": "id_tag_status", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "expiry_date": { - "name": "expiry_date", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_local_auth_list_charge_point_id_tag": { - "name": "idx_local_auth_list_charge_point_id_tag", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id_tag", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "local_auth_list_charge_point_id_charge_point_id_fk": { - "name": "local_auth_list_charge_point_id_charge_point_id_fk", - "tableFrom": "local_auth_list", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.meter_value": { - "name": "meter_value", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "transaction_id": { - "name": "transaction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "connector_id": { - "name": "connector_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_number": { - "name": "connector_number", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sampled_values": { - "name": "sampled_values", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "received_at": { - "name": "received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_meter_value_transaction_id": { - "name": "idx_meter_value_transaction_id", - "columns": [ - { - "expression": "transaction_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_meter_value_connector_id": { - "name": "idx_meter_value_connector_id", - "columns": [ - { - "expression": "connector_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_meter_value_timestamp": { - "name": "idx_meter_value_timestamp", - "columns": [ - { - "expression": "timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "meter_value_transaction_id_transaction_id_fk": { - "name": "meter_value_transaction_id_transaction_id_fk", - "tableFrom": "meter_value", - "tableTo": "transaction", - "columnsFrom": [ - "transaction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "meter_value_connector_id_connector_id_fk": { - "name": "meter_value_connector_id_connector_id_fk", - "tableFrom": "meter_value", - "tableTo": "connector", - "columnsFrom": [ - "connector_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "meter_value_charge_point_id_charge_point_id_fk": { - "name": "meter_value_charge_point_id_charge_point_id_fk", - "tableFrom": "meter_value", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.reservation": { - "name": "reservation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_id": { - "name": "connector_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "connector_number": { - "name": "connector_number", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "expiry_date": { - "name": "expiry_date", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "id_tag": { - "name": "id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true - }, - "parent_id_tag": { - "name": "parent_id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'Active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_reservation_charge_point_id": { - "name": "idx_reservation_charge_point_id", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_reservation_status": { - "name": "idx_reservation_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_reservation_expiry_date": { - "name": "idx_reservation_expiry_date", - "columns": [ - { - "expression": "expiry_date", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "reservation_charge_point_id_charge_point_id_fk": { - "name": "reservation_charge_point_id_charge_point_id_fk", - "tableFrom": "reservation", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "reservation_connector_id_connector_id_fk": { - "name": "reservation_connector_id_connector_id_fk", - "tableFrom": "reservation", - "tableTo": "connector", - "columnsFrom": [ - "connector_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.transaction": { - "name": "transaction", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_id": { - "name": "connector_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_number": { - "name": "connector_number", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "id_tag": { - "name": "id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true - }, - "id_tag_status": { - "name": "id_tag_status", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "start_timestamp": { - "name": "start_timestamp", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "start_meter_value": { - "name": "start_meter_value", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stop_id_tag": { - "name": "stop_id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "stop_timestamp": { - "name": "stop_timestamp", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "stop_meter_value": { - "name": "stop_meter_value", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "stop_reason": { - "name": "stop_reason", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "reservation_id": { - "name": "reservation_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_transaction_charge_point_id": { - "name": "idx_transaction_charge_point_id", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_transaction_connector_id": { - "name": "idx_transaction_connector_id", - "columns": [ - { - "expression": "connector_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_transaction_id_tag": { - "name": "idx_transaction_id_tag", - "columns": [ - { - "expression": "id_tag", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_transaction_start_timestamp": { - "name": "idx_transaction_start_timestamp", - "columns": [ - { - "expression": "start_timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "transaction_charge_point_id_charge_point_id_fk": { - "name": "transaction_charge_point_id_charge_point_id_fk", - "tableFrom": "transaction", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "transaction_connector_id_connector_id_fk": { - "name": "transaction_connector_id_connector_id_fk", - "tableFrom": "transaction", - "tableTo": "connector", - "columnsFrom": [ - "connector_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/csms/drizzle/meta/0003_snapshot.json b/apps/csms/drizzle/meta/0003_snapshot.json deleted file mode 100644 index 6748f84..0000000 --- a/apps/csms/drizzle/meta/0003_snapshot.json +++ /dev/null @@ -1,1680 +0,0 @@ -{ - "id": "625f31c4-cd87-4d4d-ad2b-22cf47de4295", - "prevId": "7a1c94ab-46cd-48cb-b84f-622da7a036c1", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "account_id": { - "name": "account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_id": { - "name": "provider_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token_expires_at": { - "name": "access_token_expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "refresh_token_expires_at": { - "name": "refresh_token_expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.jwks": { - "name": "jwks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "ip_address": { - "name": "ip_address", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_agent": { - "name": "user_agent", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "impersonated_by": { - "name": "impersonated_by", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "session_token_unique": { - "name": "session_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "ban_reason": { - "name": "ban_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ban_expires": { - "name": "ban_expires", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "display_username": { - "name": "display_username", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_username_unique": { - "name": "user_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.verification": { - "name": "verification", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.charge_point": { - "name": "charge_point", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "charge_point_identifier": { - "name": "charge_point_identifier", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "charge_point_serial_number": { - "name": "charge_point_serial_number", - "type": "varchar(25)", - "primaryKey": false, - "notNull": false - }, - "charge_point_model": { - "name": "charge_point_model", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true - }, - "charge_point_vendor": { - "name": "charge_point_vendor", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true - }, - "firmware_version": { - "name": "firmware_version", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "iccid": { - "name": "iccid", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "imsi": { - "name": "imsi", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "meter_serial_number": { - "name": "meter_serial_number", - "type": "varchar(25)", - "primaryKey": false, - "notNull": false - }, - "meter_type": { - "name": "meter_type", - "type": "varchar(25)", - "primaryKey": false, - "notNull": false - }, - "registration_status": { - "name": "registration_status", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'Pending'" - }, - "heartbeat_interval": { - "name": "heartbeat_interval", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 60 - }, - "last_heartbeat_at": { - "name": "last_heartbeat_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_boot_notification_at": { - "name": "last_boot_notification_at", - "type": "timestamp with time zone", - "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", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "charge_point_charge_point_identifier_unique": { - "name": "charge_point_charge_point_identifier_unique", - "nullsNotDistinct": false, - "columns": [ - "charge_point_identifier" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.charging_profile": { - "name": "charging_profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_id": { - "name": "connector_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "connector_number": { - "name": "connector_number", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "transaction_id": { - "name": "transaction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "stack_level": { - "name": "stack_level", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "charging_profile_purpose": { - "name": "charging_profile_purpose", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "charging_profile_kind": { - "name": "charging_profile_kind", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "recurrency_kind": { - "name": "recurrency_kind", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "charging_schedule": { - "name": "charging_schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_charging_profile_charge_point_id": { - "name": "idx_charging_profile_charge_point_id", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_charging_profile_connector_id": { - "name": "idx_charging_profile_connector_id", - "columns": [ - { - "expression": "connector_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_charging_profile_purpose_stack": { - "name": "idx_charging_profile_purpose_stack", - "columns": [ - { - "expression": "connector_number", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "charging_profile_purpose", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "stack_level", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "charging_profile_charge_point_id_charge_point_id_fk": { - "name": "charging_profile_charge_point_id_charge_point_id_fk", - "tableFrom": "charging_profile", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "charging_profile_connector_id_connector_id_fk": { - "name": "charging_profile_connector_id_connector_id_fk", - "tableFrom": "charging_profile", - "tableTo": "connector", - "columnsFrom": [ - "connector_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "charging_profile_transaction_id_transaction_id_fk": { - "name": "charging_profile_transaction_id_transaction_id_fk", - "tableFrom": "charging_profile", - "tableTo": "transaction", - "columnsFrom": [ - "transaction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.connector": { - "name": "connector", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_id": { - "name": "connector_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'Unavailable'" - }, - "error_code": { - "name": "error_code", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'NoError'" - }, - "info": { - "name": "info", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "vendor_id": { - "name": "vendor_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "vendor_error_code": { - "name": "vendor_error_code", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "last_status_at": { - "name": "last_status_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_connector_charge_point_id": { - "name": "idx_connector_charge_point_id", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_connector_charge_point_connector": { - "name": "idx_connector_charge_point_connector", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "connector_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "connector_charge_point_id_charge_point_id_fk": { - "name": "connector_charge_point_id_charge_point_id_fk", - "tableFrom": "connector", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.connector_status_history": { - "name": "connector_status_history", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "connector_id": { - "name": "connector_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_number": { - "name": "connector_number", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "error_code": { - "name": "error_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "info": { - "name": "info", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "vendor_id": { - "name": "vendor_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "vendor_error_code": { - "name": "vendor_error_code", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "status_timestamp": { - "name": "status_timestamp", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "received_at": { - "name": "received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_status_history_connector_id": { - "name": "idx_status_history_connector_id", - "columns": [ - { - "expression": "connector_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_status_history_timestamp": { - "name": "idx_status_history_timestamp", - "columns": [ - { - "expression": "status_timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_status_history_received_at": { - "name": "idx_status_history_received_at", - "columns": [ - { - "expression": "received_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "connector_status_history_connector_id_connector_id_fk": { - "name": "connector_status_history_connector_id_connector_id_fk", - "tableFrom": "connector_status_history", - "tableTo": "connector", - "columnsFrom": [ - "connector_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.id_tag": { - "name": "id_tag", - "schema": "", - "columns": { - "id_tag": { - "name": "id_tag", - "type": "varchar(20)", - "primaryKey": true, - "notNull": true - }, - "parent_id_tag": { - "name": "parent_id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'Accepted'" - }, - "expiry_date": { - "name": "expiry_date", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "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", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "id_tag_user_id_user_id_fk": { - "name": "id_tag_user_id_user_id_fk", - "tableFrom": "id_tag", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.local_auth_list": { - "name": "local_auth_list", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "list_version": { - "name": "list_version", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "id_tag": { - "name": "id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true - }, - "parent_id_tag": { - "name": "parent_id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "id_tag_status": { - "name": "id_tag_status", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "expiry_date": { - "name": "expiry_date", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_local_auth_list_charge_point_id_tag": { - "name": "idx_local_auth_list_charge_point_id_tag", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id_tag", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "local_auth_list_charge_point_id_charge_point_id_fk": { - "name": "local_auth_list_charge_point_id_charge_point_id_fk", - "tableFrom": "local_auth_list", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.meter_value": { - "name": "meter_value", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "transaction_id": { - "name": "transaction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "connector_id": { - "name": "connector_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_number": { - "name": "connector_number", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sampled_values": { - "name": "sampled_values", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "received_at": { - "name": "received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_meter_value_transaction_id": { - "name": "idx_meter_value_transaction_id", - "columns": [ - { - "expression": "transaction_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_meter_value_connector_id": { - "name": "idx_meter_value_connector_id", - "columns": [ - { - "expression": "connector_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_meter_value_timestamp": { - "name": "idx_meter_value_timestamp", - "columns": [ - { - "expression": "timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "meter_value_transaction_id_transaction_id_fk": { - "name": "meter_value_transaction_id_transaction_id_fk", - "tableFrom": "meter_value", - "tableTo": "transaction", - "columnsFrom": [ - "transaction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "meter_value_connector_id_connector_id_fk": { - "name": "meter_value_connector_id_connector_id_fk", - "tableFrom": "meter_value", - "tableTo": "connector", - "columnsFrom": [ - "connector_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "meter_value_charge_point_id_charge_point_id_fk": { - "name": "meter_value_charge_point_id_charge_point_id_fk", - "tableFrom": "meter_value", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.reservation": { - "name": "reservation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_id": { - "name": "connector_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "connector_number": { - "name": "connector_number", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "expiry_date": { - "name": "expiry_date", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "id_tag": { - "name": "id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true - }, - "parent_id_tag": { - "name": "parent_id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'Active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_reservation_charge_point_id": { - "name": "idx_reservation_charge_point_id", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_reservation_status": { - "name": "idx_reservation_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_reservation_expiry_date": { - "name": "idx_reservation_expiry_date", - "columns": [ - { - "expression": "expiry_date", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "reservation_charge_point_id_charge_point_id_fk": { - "name": "reservation_charge_point_id_charge_point_id_fk", - "tableFrom": "reservation", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "reservation_connector_id_connector_id_fk": { - "name": "reservation_connector_id_connector_id_fk", - "tableFrom": "reservation", - "tableTo": "connector", - "columnsFrom": [ - "connector_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.transaction": { - "name": "transaction", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "charge_point_id": { - "name": "charge_point_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_id": { - "name": "connector_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "connector_number": { - "name": "connector_number", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "id_tag": { - "name": "id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true - }, - "id_tag_status": { - "name": "id_tag_status", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "start_timestamp": { - "name": "start_timestamp", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "start_meter_value": { - "name": "start_meter_value", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stop_id_tag": { - "name": "stop_id_tag", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "stop_timestamp": { - "name": "stop_timestamp", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "stop_meter_value": { - "name": "stop_meter_value", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "stop_reason": { - "name": "stop_reason", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "charge_amount": { - "name": "charge_amount", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "reservation_id": { - "name": "reservation_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_transaction_charge_point_id": { - "name": "idx_transaction_charge_point_id", - "columns": [ - { - "expression": "charge_point_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_transaction_connector_id": { - "name": "idx_transaction_connector_id", - "columns": [ - { - "expression": "connector_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_transaction_id_tag": { - "name": "idx_transaction_id_tag", - "columns": [ - { - "expression": "id_tag", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_transaction_start_timestamp": { - "name": "idx_transaction_start_timestamp", - "columns": [ - { - "expression": "start_timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "transaction_charge_point_id_charge_point_id_fk": { - "name": "transaction_charge_point_id_charge_point_id_fk", - "tableFrom": "transaction", - "tableTo": "charge_point", - "columnsFrom": [ - "charge_point_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "transaction_connector_id_connector_id_fk": { - "name": "transaction_connector_id_connector_id_fk", - "tableFrom": "transaction", - "tableTo": "connector", - "columnsFrom": [ - "connector_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/csms/drizzle/meta/_journal.json b/apps/csms/drizzle/meta/_journal.json index 4efc3f3..122a87b 100644 --- a/apps/csms/drizzle/meta/_journal.json +++ b/apps/csms/drizzle/meta/_journal.json @@ -5,29 +5,8 @@ { "idx": 0, "version": "7", - "when": 1763319356169, - "tag": "0000_real_garia", - "breakpoints": true - }, - { - "idx": 1, - "version": "7", - "when": 1763319683557, - "tag": "0001_gorgeous_invisible_woman", - "breakpoints": true - }, - { - "idx": 2, - "version": "7", - "when": 1773109529038, - "tag": "0002_melodic_moondragon", - "breakpoints": true - }, - { - "idx": 3, - "version": "7", - "when": 1773148285424, - "tag": "0003_fluffy_morbius", + "when": 1773148750321, + "tag": "0000_last_big_bertha", "breakpoints": true } ]