first couple models working, now let's add more

This commit is contained in:
counterweight 2025-03-10 12:47:09 +01:00
parent f5ced9888e
commit 9d4967a41d
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C

View file

@ -1,8 +1,10 @@
'use strict'; 'use strict';
module.exports = { module.exports = {
up: (queryInterface, Sequelize) => { up: (queryInterface, Sequelize) => {
return queryInterface.createTable( return queryInterface.sequelize.transaction((t) => {
'AppInviteCreated', return Promise.all([
queryInterface.createTable(
'app_invite_created',
{ {
uuid: { uuid: {
type: Sequelize.UUID, type: Sequelize.UUID,
@ -19,10 +21,34 @@ module.exports = {
allowNull: false, allowNull: false,
}, },
}, },
{ transaction: t }
),
queryInterface.createTable(
'contact_details_set',
{ {
tableName: 'app_invite_created', uuid: {
} type: Sequelize.UUID,
); allowNull: false,
unique: true,
primaryKey: true,
},
public_key: {
type: Sequelize.STRING,
allowNull: false,
},
encrypted_contact_details: {
type: Sequelize.TEXT,
allowNull: false,
},
created_at: {
type: Sequelize.DATE,
allowNull: false,
},
},
{ transaction: t }
),
]);
});
}, },
down: (queryInterface, Sequelize) => { down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('Users'); return queryInterface.dropTable('Users');