`drizzle-kit push` trying to remove drizzle's own sequence causing errors
$ bunx drizzle-kit push
drizzle-kit: v0.23.0
drizzle-orm: v0.32.0
No config path provided, using default path
Reading config file '/workspaces/hashira/packages/db/drizzle.config.ts'
Using 'pg' driver for database querying
[✓] Pulling schema from database...
Warning You are about to execute current statements:
ALTER TABLE "core_wallet" DROP CONSTRAINT "core_wallet_userId_name_unique";
ALTER TABLE "core_users" ALTER COLUMN "married_to" SET DEFAULT null;
ALTER TABLE "core_task" ALTER COLUMN "identifier" SET DEFAULT gen_random_uuid()::text;
ALTER TABLE "core_wallet" ADD CONSTRAINT "core_wallet_userId_name_unique" UNIQUE("userId","name");
DROP SEQUENCE "drizzle"."__drizzle_migrations_id_seq";
error: cannot drop sequence drizzle.__drizzle_migrations_id_seq because other objects depend on it
at /workspaces/hashira/node_modules/drizzle-kit/bin.cjs:79476:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.query (/workspaces/hashira/node_modules/drizzle-kit/bin.cjs:121418:26)
at async pgPush (/workspaces/hashira/node_modules/drizzle-kit/bin.cjs:124361:13)
at async _Command.<anonymous> (/workspaces/hashira/node_modules/drizzle-kit/bin.cjs:131618:7) {
length: 343,
severity: 'ERROR',
code: '2BP01',
detail: 'default value for column id of table drizzle.__drizzle_migrations depends on sequence drizzle.__drizzle_migrations_id_seq',
hint: 'Use DROP ... CASCADE to drop the dependent objects too.',
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'dependency.c',
line: '1197',
routine: 'reportDependentObjects'
}
$ bunx drizzle-kit push
drizzle-kit: v0.23.0
drizzle-orm: v0.32.0
No config path provided, using default path
Reading config file '/workspaces/hashira/packages/db/drizzle.config.ts'
Using 'pg' driver for database querying
[✓] Pulling schema from database...
Warning You are about to execute current statements:
ALTER TABLE "core_wallet" DROP CONSTRAINT "core_wallet_userId_name_unique";
ALTER TABLE "core_users" ALTER COLUMN "married_to" SET DEFAULT null;
ALTER TABLE "core_task" ALTER COLUMN "identifier" SET DEFAULT gen_random_uuid()::text;
ALTER TABLE "core_wallet" ADD CONSTRAINT "core_wallet_userId_name_unique" UNIQUE("userId","name");
DROP SEQUENCE "drizzle"."__drizzle_migrations_id_seq";
error: cannot drop sequence drizzle.__drizzle_migrations_id_seq because other objects depend on it
at /workspaces/hashira/node_modules/drizzle-kit/bin.cjs:79476:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.query (/workspaces/hashira/node_modules/drizzle-kit/bin.cjs:121418:26)
at async pgPush (/workspaces/hashira/node_modules/drizzle-kit/bin.cjs:124361:13)
at async _Command.<anonymous> (/workspaces/hashira/node_modules/drizzle-kit/bin.cjs:131618:7) {
length: 343,
severity: 'ERROR',
code: '2BP01',
detail: 'default value for column id of table drizzle.__drizzle_migrations depends on sequence drizzle.__drizzle_migrations_id_seq',
hint: 'Use DROP ... CASCADE to drop the dependent objects too.',
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'dependency.c',
line: '1197',
routine: 'reportDependentObjects'
}
1 Reply
BUMP