Can't drop a column in a migration
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, mariadb, mysql
- Ambito
- databases
Direzione di ricerca
Start by reproducing the migration's queryInterface.removeColumn call against MariaDB 10.7, using the SQL and error shown in the issue. Trace the removeColumn implementation and its constraint lookup, then verify that the migration completes and the id_Sage column is dropped without the reported error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What you are doing?
'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.removeColumn('user', 'id_Sage', {
logging: (sql) => console.error(sql),
});
},
async down(queryInterface, Sequelize) {
return false;
},
};
What do you expect to happen?
I expected the column to be dropped
What is actually happening?
An error occurs which prevents me from migrating my DB
▶ yarn run db:migrate
yarn run v1.22.19
$ sequelize db:migrate
Sequelize CLI [Node: 18.14.0, CLI: 6.6.0, ORM: 6.6.5]
Loaded configuration file "libs/db/src/config/database/index.js".
Using environment "development".
== 20230224101241-remove-idSage-from-user: migrating =======
Executing (default): SELECT CONSTRAINT_NAME as constraint_name,CONSTRAINT_NAME as constraintName,CONSTRAINT_SCHEMA as constraintSchema,CONSTRAINT_SCHEMA as constraintCatalog,TABLE_NAME as tableName,TABLE_SCHEMA as tableSchema,TABLE_SCHEMA as tableCatalog,COLUMN_NAME as columnName,REFERENCED_TABLE_SCHEMA as referencedTableSchema,REFERENCED_TABLE_SCHEMA as referencedTableCatalog,REFERENCED_TABLE_NAME as referencedTableName,REFERENCED_COLUMN_NAME as referencedColumnName FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE (REFERENCED_TABLE_NAME = 'user' AND REFERENCED_TABLE_SCHEMA = 'database' AND REFERENCED_COLUMN_NAME = 'id_Sage') OR (TABLE_NAME = 'user' AND TABLE_SCHEMA = 'database' AND COLUMN_NAME = 'id_Sage' AND REFERENCED_TABLE_NAME IS NOT NULL)
ERROR: Cannot delete property 'meta' of [object Array]
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Dialect: mysql/mariadb
Database version: 10.7
Sequelize CLI version: 6.6.0
Sequelize version: 6.6.5
- Lingua principale
- JavaScript
- Stelle
- 2.6k
- Fork
- 524
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sequelize/cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Tutte le issue di sequelize/cli
Issue simili
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
apache/cloudstack#14222 ·
-
Browser Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
getsentry/sentry-javascript#24577 · 1 commento ·
-
curation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
amponce/archive-movie-browser#186 ·
-
light
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
aemdemos/patients-stryker#253 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
clerk/javascript#9852 ·