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
Migrating in SQLITE: dropColumn throws error #3473
Comments
Knex Version is: "0.17.3" |
Can you please share the result of the following (from sqlite shell): select name, sql from sqlite_master where type = "table" and name = "USER" |
Result for XC_USER: name: XC_USER |
Should the method even be called at all? Because i'm trying to drop a column and not create a table |
SQLite doesn't support renaming or dropping columns with a single query: https://www.sqlite.org/lang_altertable.html |
1. Fix regex match failure when table has not been created through knex's createTable (Closes #3473) 2. Handle all quote variants supported by SQLite. 3. Fix incorrect handling of foreign keys & constraints
Released in 0.20.0 |
sqllite Version:
"sqlite3": "4.0.2",
If you have a migration with dropColumn, you'll get the error:
TypeError: Cannot read property '1' of null
Because in knex\lib\dialects\sqlite3\schema\ddl.js:
_doReplace() is being called and the Regex searches for "CREATE TABLE..."
Migration:
builder.schema.alterTable('USER', table => { table.dropColumn('DESCRIPTION'); });
Is there a workaround or alternative to dropping columns/changing the column type?
dropColumns() throws the same error btw
The text was updated successfully, but these errors were encountered: