I want to create migrations only for "currentSchema", but when I am trying to push a new migration, drizzle kit is trying to delete sequences from other postgresql schemas
Generate migration via drizzle-kit generate
You will see something an expected migration file without DROP statements
CREATE SCHEMA "currentSchema"; -- unrelated but also a bug https://github.com/drizzle-team/drizzle-orm/issues/2335
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "currentSchema"."groups" (
"id" uuid PRIMARY KEY NOT NULL
);
drizzle-kit push
-- drizzle-kit: v0.23.0
-- drizzle-orm: v0.32.0
-- Warning You are about to execute current statements:
CREATE SCHEMA "currentSchema";
CREATE TABLE IF NOT EXISTS "currentSchema"."groups" (
"id" uuid PRIMARY KEY NOT NULL
);
DROP SEQUENCE "ANOTHER_SCHEMA"."cities_id_seq";
DROP SEQUENCE "THIRD_SCHEMA"."users_id_seq";
These drop statements cause errors
`cannot drop sequence ANOTHER_SCHEMA.cities_id_seq because other objects depend on it`
### Expected behavior
This bug appers only while using drizzle-kit 0.23.
When I am using drizzle-kit 0.22.8 and drizzle-orm 0.32 everything is ok.
drizzle-kit (0.22.8) push will print something this:
```sql
-- drizzle-kit: v0.22.8
-- drizzle-orm: v0.32.0
-- Warning You are about to execute current statements:
CREATE SCHEMA "currentSchema";
CREATE TABLE IF NOT EXISTS "currentSchema"."groups" (
"id" uuid PRIMARY KEY NOT NULL
);
Environment & setup
postgresql with at least 2 schemas ("currentSchema" and "ANOTHER_SCHEMA")
drizzle-kit: v0.23.0
drizzle-orm: v0.32.0
using postgres.js v3.4.4
What version of
drizzle-orm
are you using?0.32
What version of
drizzle-kit
are you using?0.23
Describe the Bug
I want to create migrations only for "currentSchema", but when I am trying to push a new migration, drizzle kit is trying to delete sequences from other postgresql schemas
Define config
Define any model
Generate migration via
drizzle-kit generate
You will see something an expected migration file without DROP statementsdrizzle-kit push
CREATE SCHEMA "currentSchema";
CREATE TABLE IF NOT EXISTS "currentSchema"."groups" ( "id" uuid PRIMARY KEY NOT NULL );
DROP SEQUENCE "ANOTHER_SCHEMA"."cities_id_seq"; DROP SEQUENCE "THIRD_SCHEMA"."users_id_seq";
Environment & setup
postgresql with at least 2 schemas ("currentSchema" and "ANOTHER_SCHEMA") drizzle-kit: v0.23.0 drizzle-orm: v0.32.0 using postgres.js v3.4.4