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,51 @@
'use strict';
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable('Events', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
title: {
type: Sequelize.STRING,
allowNull: false
},
description: {
type: Sequelize.TEXT
},
date: {
type: Sequelize.DATE,
allowNull: false
},
repeat: {
type: Sequelize.STRING
},
interval: {
type: Sequelize.INTEGER
},
institution_id: {
type: Sequelize.INTEGER,
references: {
model: 'institutions',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
},
event_place_id: {
type: Sequelize.INTEGER,
references: {
model: 'event_places',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'SET NULL'
}
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.dropTable('Events');
}
};