Files
lobehub/packages/database/migrations/0083_remove_id_seq_identity_column.sql
Neko b0def6d711 👷 build(database): migrate id using seq and identity to text with nanoid (#12223)
* 🔨 chore(database): added id_nanoid to replace id using seq and identity

* 🔨 chore(database): assgin database id column value to id_nanoid

* 🔨 chore(database): update dbml

* 🔨 chore(database): add not null & unique index

* 🔨 chore(database): drop foreign key dependency, switch to depend on id_nanoid

* 🔨 chore(database): switch to use id_nanoid as primary key

* 🔨 chore(database): drop old id column

* 🔨 chore(database): rename id_nanoid to id

* 🔨 chore(database): remove unique constraint

* 🔨 chore(database): updated dbml

* 🔨 chore(database): incorrect --> statement-breakpoint
2026-02-09 22:27:46 +08:00

8 lines
567 B
SQL

ALTER TABLE "api_keys" DROP COLUMN IF EXISTS "id";--> statement-breakpoint
ALTER TABLE "rag_eval_dataset_records" DROP COLUMN IF EXISTS "id";--> statement-breakpoint
ALTER TABLE "rag_eval_datasets" DROP COLUMN IF EXISTS "id";--> statement-breakpoint
ALTER TABLE "rag_eval_evaluations" DROP COLUMN IF EXISTS "id";--> statement-breakpoint
ALTER TABLE "rag_eval_evaluation_records" DROP COLUMN IF EXISTS "id";--> statement-breakpoint
ALTER TABLE "rbac_permissions" DROP COLUMN IF EXISTS "id";--> statement-breakpoint
ALTER TABLE "rbac_roles" DROP COLUMN IF EXISTS "id";