You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,I have table with 5 column and 1000 row, I want rename second column from imageUrl to slug for example.
and I want sequelize do not delete row in old column and don't want create new column
only I want rename column with all rows.
but in this code
import { Post } from '/post/entities/post.entity';
import { Module } from '@nestjs/common';
import { SequelizeModule } from '@nestjs/sequelize';
Sequelize create new column with name slug and remove imageUrl and the row in imageUrl not transfered to slug column and slug column have empty or null row.
if I change : sync: { alter: true } to sync: { alter: { drop : false }}, Sequelize create new column with name slug and imageUrl exist too.
if I change : sync: { alter: true } to sync: { force :true }, Sequelize delete all rows
Hi,I have table with 5 column and 1000 row, I want rename second column from
imageUrl
toslug
for example.and I want sequelize do not delete row in old column and don't want create new column
only I want rename column with all rows.
but in this code
import { Post } from '/post/entities/post.entity';
import { Module } from '@nestjs/common';
import { SequelizeModule } from '@nestjs/sequelize';
@module({
imports: [
SequelizeModule.forRoot({
dialect: 'mysql',
host: host,
port: port,
username: user,
password: pass,
database: db,
models: [Post ],
logging: true,
autoLoadModels: true,
synchronize: true,
sync: { alter: true },
}),
],
exports: [SequelizeModule],
})
export class DatabaseModule {}
Sequelize create new column with name
slug
and removeimageUrl
and the row in imageUrl not transfered toslug
column andslug
column have empty or null row.if I change :
sync: { alter: true }
tosync: { alter: { drop : false }},
Sequelize create new column with nameslug
andimageUrl
exist too.if I change :
sync: { alter: true }
tosync: { force :true },
Sequelize delete all rowsso How can fix that ?
Versions
"@nestjs/sequelize": "^9.0.2",
"sequelize": "^6.32.1",
"sequelize-typescript": "^2.1.5",
"@types/sequelize": "^4.28.15",
"typescript": "^4.7.4"
Framework
I Using nest.js
The text was updated successfully, but these errors were encountered: