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

Why is using soft deletion ineffective #1718

Open
2 tasks
AgileZM opened this issue Mar 31, 2024 · 0 comments
Open
2 tasks

Why is using soft deletion ineffective #1718

AgileZM opened this issue Mar 31, 2024 · 0 comments

Comments

@AgileZM
Copy link

AgileZM commented Mar 31, 2024

Issue

If Paranoid: true is configured, data will still be deleted

Versions

  • sequelize: ^6.37.1
  • sequelize-typescript: ^2.1.6
  • typescript: 4.8.4

Issue type

  • bug report
  • feature request

Actual behavior

Expected behavior

Steps to reproduce

Related code

sequelize: {
    dataSource: {
      default: {
        database: process.env["DATABASE_DATABASE"],
        username: process.env["DATABASE_USERNAME"],
        password: process.env["DATABASE_PASSWORD"],
        host: process.env["DATABASE_HOST"],
        port: process.env["DATABASE_PORT"],
        encrypt: false,
        dialect: "mysql",
        define: {
          charset: "utf8",
          timestamps: true,
          paranoid: true,
          underscored: true,
          freezeTableName: true,
          engine: "innodb",
        },
        entities: [
          "**/entity/*{.ts,.js}"
        ]
      }
    }
  }

 @Column({ field: 'created_at', allowNull: true, type: DataType.DATE })
  createdAt?: Date;

 @Column({ field: 'updated_at', allowNull: true, type: DataType.DATE })
  updatedAt?: Date;

  @Column({ field: 'deleted_at', allowNull: true, type: DataType.DATE })
  deletedAt?: Date;
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