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

Fix Rename Column syntax #22

Open
Rodriguespn opened this issue Dec 11, 2024 · 0 comments
Open

Fix Rename Column syntax #22

Rodriguespn opened this issue Dec 11, 2024 · 0 comments

Comments

@Rodriguespn
Copy link

Correct syntax: ALTER TABLE <table_name> CHANGE <old_name> <new_name>;
Source

Reported by @demenskyi


@repo/[email protected] push
drizzle-kit push
No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/ydemenskyi/dev/user-insights-platform/packages/db/drizzle.config.ts'
[✓] Pulling schema from database...
Reading schema files:
/Users/ydemenskyi/dev/user-insights-platform/packages/db/schema.ts
~ platform_activity_id › platform_account_activity_id column will be renamed
--- all columns conflicts in user_platform_account_activities table resolved ---
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLUMN platform_activity_id TO platform_account_activity_id' at line 1
at PromiseConnection.execute (/Users/ydemenskyi/dev/user-insights-platform/node_modules/mysql2/lib/promise/connection.js:47:22)
at Object.query (/Users/ydemenskyi/dev/user-insights-platform/node_modules/drizzle-kit/bin.cjs:78808:40)
at singlestorePush (/Users/ydemenskyi/dev/user-insights-platform/node_modules/drizzle-kit/bin.cjs:82012:22)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.handler (/Users/ydemenskyi/dev/user-insights-platform/node_modules/drizzle-kit/bin.cjs:92091:9)
at async run (/Users/ydemenskyi/dev/user-insights-platform/node_modules/drizzle-kit/bin.cjs:90366:7) {
code: 'ER_PARSE_ERROR',
errno: 1064,
sql: 'ALTER TABLE user_platform_account_activities RENAME COLUMN platform_activity_id TO platform_account_activity_id;',
sqlState: '42000',
sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLUMN platform_activity_id TO platform_account_activity_id' at line 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

1 participant