Skip to content

Commit

Permalink
Merge pull request #4342 from NMDSdevopsServiceAdm/test
Browse files Browse the repository at this point in the history
Test > Live: Sharing permissions, admin search main page, bug fixes
  • Loading branch information
joannafawl authored Nov 30, 2021
2 parents 7bd5777 + 1bb6f4c commit cf274ae
Show file tree
Hide file tree
Showing 90 changed files with 2,181 additions and 1,734 deletions.
19 changes: 19 additions & 0 deletions migrations/20211115095343-deleteShareDataValueColumn.js
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,
});
},
};
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 migrations/20211115163843-allowNullInShareLaAndLocalAuthorities.js
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 migrations/20211117105307-deleteShareWithLAUnusedColumn.js
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 },
),
]);
});
},
};
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',
},
);
},
};
15 changes: 15 additions & 0 deletions migrations/20211118140214-updateShareWithCQCAndLA.js
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 },
),
]);
});
},
};
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\';',
);
},
};
Loading

0 comments on commit cf274ae

Please sign in to comment.