-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4342 from NMDSdevopsServiceAdm/test
Test > Live: Sharing permissions, admin search main page, bug fixes
- Loading branch information
Showing
90 changed files
with
2,181 additions
and
1,734 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
const establishmentTable = { | ||
tableName: 'Establishment', | ||
schema: 'cqc', | ||
}; | ||
|
||
module.exports = { | ||
up: async (queryInterface) => { | ||
return queryInterface.removeColumn(establishmentTable, 'ShareDataValue'); | ||
}, | ||
|
||
down: async (queryInterface, Sequelize) => { | ||
return queryInterface.addColumn(establishmentTable, 'ShareDataValue', { | ||
type: Sequelize.DataTypes.BOOLEAN, | ||
allowNull: true, | ||
}); | ||
}, | ||
}; |
31 changes: 31 additions & 0 deletions
31
migrations/20211115143507-addShowSharingPermissionsBannerColumnToEstablishmentTable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use strict'; | ||
|
||
const table = { | ||
tableName: 'Establishment', | ||
schema: 'cqc', | ||
}; | ||
|
||
module.exports = { | ||
up: (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction(async (transaction) => { | ||
return Promise.all([ | ||
await queryInterface.addColumn( | ||
table, | ||
'ShowSharingPermissionsBanner', | ||
{ | ||
type: Sequelize.DataTypes.BOOLEAN, | ||
defaultValue: false, | ||
}, | ||
{ transaction }, | ||
), | ||
await queryInterface.sequelize.query('UPDATE cqc."Establishment" SET "ShowSharingPermissionsBanner" = true;', { | ||
transaction, | ||
}), | ||
]); | ||
}); | ||
}, | ||
|
||
down: (queryInterface) => { | ||
return queryInterface.removeColumn(table, 'ShowSharingPermissionsBanner'); | ||
}, | ||
}; |
58 changes: 58 additions & 0 deletions
58
migrations/20211115163843-allowNullInShareLaAndLocalAuthorities.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
'use strict'; | ||
|
||
const establishmentTable = { | ||
tableName: 'Establishment', | ||
schema: 'cqc', | ||
}; | ||
|
||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction(async (transaction) => { | ||
await Promise.all([ | ||
queryInterface.changeColumn( | ||
establishmentTable, | ||
'ShareDataWithCQC', | ||
{ | ||
type: Sequelize.DataTypes.BOOLEAN, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
queryInterface.changeColumn( | ||
establishmentTable, | ||
'ShareDataWithLA', | ||
{ | ||
type: Sequelize.DataTypes.BOOLEAN, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
]); | ||
}); | ||
}, | ||
|
||
down: async (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction(async (transaction) => { | ||
await Promise.all([ | ||
queryInterface.changeColumn( | ||
establishmentTable, | ||
'ShareDataWithCQC', | ||
{ | ||
type: Sequelize.DataTypes.BOOLEAN, | ||
allowNull: false, | ||
}, | ||
{ transaction }, | ||
), | ||
queryInterface.changeColumn( | ||
establishmentTable, | ||
'ShareDataWithLA', | ||
{ | ||
type: Sequelize.DataTypes.BOOLEAN, | ||
allowNull: false, | ||
}, | ||
{ transaction }, | ||
), | ||
]); | ||
}); | ||
}, | ||
}; |
62 changes: 62 additions & 0 deletions
62
migrations/20211117105307-deleteShareWithLAUnusedColumn.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
'use strict'; | ||
|
||
const establishmentTable = { | ||
tableName: 'Establishment', | ||
schema: 'cqc', | ||
}; | ||
|
||
module.exports = { | ||
up: async (queryInterface) => { | ||
return queryInterface.sequelize.transaction(async (transaction) => { | ||
await Promise.all([ | ||
queryInterface.removeColumn(establishmentTable, 'ShareWithLASavedAt', { transaction }), | ||
queryInterface.removeColumn(establishmentTable, 'ShareWithLAChangedAt', { transaction }), | ||
queryInterface.removeColumn(establishmentTable, 'ShareWithLASavedBy', { transaction }), | ||
queryInterface.removeColumn(establishmentTable, 'ShareWithLAChangedBy', { transaction }), | ||
]); | ||
}); | ||
}, | ||
|
||
down: async (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction(async (transaction) => { | ||
await Promise.all([ | ||
queryInterface.addColumn( | ||
establishmentTable, | ||
'ShareWithLASavedAt', | ||
{ | ||
type: Sequelize.DataTypes.DATE, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
queryInterface.addColumn( | ||
establishmentTable, | ||
'ShareWithLAChangedAt', | ||
{ | ||
type: Sequelize.DataTypes.DATE, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
queryInterface.addColumn( | ||
establishmentTable, | ||
'ShareWithLASavedBy', | ||
{ | ||
type: Sequelize.DataTypes.TEXT, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
queryInterface.addColumn( | ||
establishmentTable, | ||
'ShareWithLAChangedBy', | ||
{ | ||
type: Sequelize.DataTypes.TEXT, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
]); | ||
}); | ||
}, | ||
}; |
44 changes: 44 additions & 0 deletions
44
migrations/20211118104627-deleteEstablishmentLocalAuthorityTable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
up: async (queryInterface) => { | ||
return queryInterface.dropTable({ | ||
schema: 'cqc', | ||
tableName: 'EstablishmentLocalAuthority', | ||
}); | ||
}, | ||
|
||
down: async (queryInterface, Sequelize) => { | ||
queryInterface.createTable( | ||
'EstablishmentLocalAuthority', | ||
{ | ||
EstablishmentLocalAuthorityID: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
primaryKey: true, | ||
}, | ||
EstablishmentID: { | ||
type: Sequelize.INTEGER, | ||
references: { | ||
model: { | ||
tableName: 'Establishment', | ||
schema: 'cqc', | ||
}, | ||
key: 'EstablishmentID', | ||
}, | ||
}, | ||
CssrID: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
}, | ||
CssR: { | ||
type: Sequelize.TEXT, | ||
allowNull: false, | ||
}, | ||
}, | ||
{ | ||
schema: 'cqc', | ||
}, | ||
); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
up: async (queryInterface) => { | ||
return queryInterface.sequelize.transaction(async (transaction) => { | ||
await Promise.all([ | ||
queryInterface.sequelize.query('update cqc."Establishment" SET "ShareDataWithLA" = null ;', { transaction }), | ||
queryInterface.sequelize.query( | ||
'update cqc."Establishment" SET "ShareDataWithCQC" = null where "ShareDataWithCQC" = false;', | ||
{ transaction }, | ||
), | ||
]); | ||
}); | ||
}, | ||
}; |
9 changes: 9 additions & 0 deletions
9
migrations/20211129090805-setShowSharingPermissionsBannerToFalseForPendingRegistrations.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
up: async (queryInterface) => { | ||
return queryInterface.sequelize.query( | ||
'UPDATE cqc."Establishment" SET "ShowSharingPermissionsBanner" = false WHERE "Status" = \'PENDING\' OR "Status" = \'IN PROGRESS\';', | ||
); | ||
}, | ||
}; |
Oops, something went wrong.