Spaces:
Runtime error
Runtime error
Commit ·
008962f
1
Parent(s): b077308
remove unique constraint from name in pw glaccounts
Browse files
src/db/migrations/20250218135840-remove-unique-constraint-from-name-in-pw-glaccounts.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
/** @type {import('sequelize-cli').Migration} */
|
| 4 |
+
module.exports = {
|
| 5 |
+
async up (queryInterface, Sequelize) {
|
| 6 |
+
|
| 7 |
+
await queryInterface.removeIndex("pw_glaccounts", "name");
|
| 8 |
+
|
| 9 |
+
await queryInterface.changeColumn("pw_glaccounts", "name", {
|
| 10 |
+
type: Sequelize.STRING(100),
|
| 11 |
+
unique: false,
|
| 12 |
+
});
|
| 13 |
+
|
| 14 |
+
},
|
| 15 |
+
|
| 16 |
+
async down (queryInterface, Sequelize) {
|
| 17 |
+
|
| 18 |
+
await queryInterface.changeColumn("pw_glaccounts", "name", {
|
| 19 |
+
type: Sequelize.STRING(100),
|
| 20 |
+
unique: true,
|
| 21 |
+
});
|
| 22 |
+
|
| 23 |
+
await queryInterface.addIndex("pw_glaccounts", ["name"], {
|
| 24 |
+
unique: true,
|
| 25 |
+
name: "name",
|
| 26 |
+
});
|
| 27 |
+
}
|
| 28 |
+
};
|
src/models/pwGlaccounts.ts
CHANGED
|
@@ -30,7 +30,6 @@ PWGlaccounts.init(
|
|
| 30 |
name: {
|
| 31 |
type: DataTypes.STRING,
|
| 32 |
allowNull: false,
|
| 33 |
-
unique: true,
|
| 34 |
},
|
| 35 |
account_number: {
|
| 36 |
type: DataTypes.STRING,
|
|
|
|
| 30 |
name: {
|
| 31 |
type: DataTypes.STRING,
|
| 32 |
allowNull: false,
|
|
|
|
| 33 |
},
|
| 34 |
account_number: {
|
| 35 |
type: DataTypes.STRING,
|