inital commit

This commit is contained in:
Torsten Schulz
2024-06-15 23:01:46 +02:00
parent 1b7fefe381
commit 61653ff407
105 changed files with 7805 additions and 524 deletions

View File

@@ -0,0 +1,68 @@
'use strict';
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable('institutions', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
name: {
type: Sequelize.STRING,
allowNull: false
},
street: {
type: Sequelize.STRING,
allowNull: true
},
zipcode: {
type: Sequelize.STRING,
allowNull: true
},
city: {
type: Sequelize.STRING,
allowNull: true
},
phone: {
type: Sequelize.STRING,
allowNull: true
},
fax: {
type: Sequelize.STRING,
allowNull: true
},
email: {
type: Sequelize.STRING,
allowNull: true
}
});
await queryInterface.createTable('InstitutionContactPerson', {
institution_id: {
type: Sequelize.INTEGER,
references: {
model: 'institutions',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE'
},
contact_person_id: {
type: Sequelize.INTEGER,
references: {
model: 'contact_persons',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE'
}
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.dropTable('InstitutionContactPerson');
await queryInterface.dropTable('institutions');
}
};