Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with dropping a table that contains upper case letters in the name. #43

Closed
JonoPrest opened this issue May 2, 2023 · 2 comments
Closed

Comments

@JonoPrest
Copy link

These are the steps to recreate the issues:

I create a table called "myTest1" (contains uppercase "T").
The following migration is generated by drizzle-kit in a file called "0000_zippy_rage.sql":

CREATE TABLE IF NOT EXISTS "myTest1" (
	"id" text PRIMARY KEY NOT NULL,
	"owner" text,
	"displayName" text,
	"imageUrl" text,
	"updatesCount" text
);

Running migrate on this works perfectly.

Next I change the name in my schema to "myTest2" and select create table instead of rename table:
Screenshot 2023-05-02 at 13 16 47

The following migration is generated in a file called "0001_wandering_tana_nile.sql":

CREATE TABLE IF NOT EXISTS "myTest2" (
	"id" text PRIMARY KEY NOT NULL,
	"owner" text,
	"displayName" text,
	"imageUrl" text,
	"updatesCount" text
);

DROP TABLE myTest1;

Note how the command DROP TABLE myTest1; does not use quotes around "myTest1".

When I run this migration I get this error in my terminal: error: table "mytest1" does not exist

As far as I know without quotes this command won't work. Perhaps it's a simple matter of adding these quotes into drizzlekit functionality.

@AndriiSherman
Copy link
Member

What version of drizzle kit are you using?

@AndriiSherman
Copy link
Member

Fixed in drizzle-kit@0.18.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants