gancio-upstream/server/migrations/20190605141850-create-event.js

69 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-06-07 17:02:33 +02:00
'use strict'
2019-06-06 23:54:32 +02:00
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('events', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
title: {
type: Sequelize.STRING
},
slug: {
type: Sequelize.STRING,
2019-06-07 17:02:33 +02:00
index: true
2019-06-06 23:54:32 +02:00
},
description: {
type: Sequelize.TEXT
},
multidate: {
type: Sequelize.BOOLEAN
},
start_datetime: {
type: Sequelize.INTEGER,
index: true
2019-06-06 23:54:32 +02:00
},
end_datetime: {
type: Sequelize.INTEGER,
index: true
2019-06-06 23:54:32 +02:00
},
image_path: {
type: Sequelize.STRING
},
is_visible: {
type: Sequelize.BOOLEAN
},
activitypub_id: {
type: Sequelize.BIGINT
},
userId: {
type: Sequelize.INTEGER,
references: {
model: 'users',
key: 'id'
}
},
placeId: {
type: Sequelize.INTEGER,
references: {
model: 'places',
key: 'id'
}
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
2019-06-07 17:02:33 +02:00
})
2019-06-06 23:54:32 +02:00
},
down: (queryInterface, Sequelize) => {
2019-06-07 17:02:33 +02:00
return queryInterface.dropTable('events')
2019-06-06 23:54:32 +02:00
}
2019-06-07 17:02:33 +02:00
}