prenez-le-train/server/migrations/20230623122607-create-airport.js

43 lines
919 B
JavaScript

'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('Airports', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
name: {
type: Sequelize.STRING
},
iata_code: {
type: Sequelize.STRING
},
icao_code: {
type: Sequelize.STRING
},
lat: {
type: Sequelize.FLOAT
},
lng: {
type: Sequelize.FLOAT
},
country_code: {
type: Sequelize.STRING
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('Airports');
}
};