prenez-le-train/server/migrations/20230623122947-create-flight.js

89 lines
1.8 KiB
JavaScript

'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('Flights', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
airline_iata: {
type: Sequelize.STRING
},
airline_icao: {
type: Sequelize.STRING
},
flight_number: {
type: Sequelize.STRING
},
flight_iata: {
type: Sequelize.STRING
},
flight_icao: {
type: Sequelize.STRING
},
cs_airline_data: {
type: Sequelize.STRING
},
cs_flight_iata: {
type: Sequelize.STRING
},
cs_flight_number: {
type: Sequelize.STRING
},
dep_iata: {
type: Sequelize.STRING
},
dep_icao: {
type: Sequelize.STRING
},
dep_terminals: {
type: Sequelize.JSON
},
dep_time: {
type: Sequelize.TIME
},
dep_time_utc: {
type: Sequelize.TIME
},
arr_iata: {
type: Sequelize.STRING
},
arr_icao: {
type: Sequelize.STRING
},
arr_terminals: {
type: Sequelize.JSON
},
arr_time: {
type: Sequelize.TIME
},
arr_time_utc: {
type: Sequelize.TIME
},
duration: {
type: Sequelize.INTEGER
},
updated: {
type: Sequelize.DATE
},
days: {
type: Sequelize.JSON
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('Flights');
}
};