'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		await queryInterface.dropTable('buses');
	},

	async down(queryInterface, Sequelize) {
		await queryInterface.createTable('buses', {
			id: {
				type: Sequelize.UUID,
				defaultValue: Sequelize.UUIDV4,
				allowNull: false,
				primaryKey: true,
			},
			bus_number: {
				type: Sequelize.STRING,
				allowNull: false,
			},
			longitude: {
				type: Sequelize.DECIMAL(11, 8),
				allowNull: false,
			},
			latitude: {
				type: Sequelize.DECIMAL(10, 8),
				allowNull: false,
			},
		});
	},
};
