43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
'use strict';
|
|
const {
|
|
Model
|
|
} = require('sequelize');
|
|
module.exports = (sequelize, DataTypes) => {
|
|
class Flight extends Model {
|
|
/**
|
|
* Helper method for defining associations.
|
|
* This method is not a part of Sequelize lifecycle.
|
|
* The `models/index` file will call this method automatically.
|
|
*/
|
|
static associate(models) {
|
|
// define association here
|
|
}
|
|
}
|
|
Flight.init({
|
|
airline_iata: DataTypes.STRING,
|
|
airline_icao: DataTypes.STRING,
|
|
flight_number: DataTypes.STRING,
|
|
flight_iata: DataTypes.STRING,
|
|
flight_icao: DataTypes.STRING,
|
|
cs_airline_data: DataTypes.STRING,
|
|
cs_flight_iata: DataTypes.STRING,
|
|
cs_flight_number: DataTypes.STRING,
|
|
dep_iata: DataTypes.STRING,
|
|
dep_icao: DataTypes.STRING,
|
|
dep_terminals: DataTypes.JSON,
|
|
dep_time: DataTypes.TIME,
|
|
dep_time_utc: DataTypes.TIME,
|
|
arr_iata: DataTypes.STRING,
|
|
arr_icao: DataTypes.STRING,
|
|
arr_terminals: DataTypes.JSON,
|
|
arr_time: DataTypes.TIME,
|
|
arr_time_utc: DataTypes.TIME,
|
|
duration: DataTypes.INTEGER,
|
|
updated: DataTypes.DATE,
|
|
days: DataTypes.JSON
|
|
}, {
|
|
sequelize,
|
|
modelName: 'Flight',
|
|
});
|
|
return Flight;
|
|
}; |