link creation/deletion

This commit is contained in:
2024-07-30 19:25:23 +05:30
parent a634ea0fb2
commit 971698b318
10 changed files with 317 additions and 30 deletions

View File

@@ -2,7 +2,7 @@
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('userPlaylists', {
await queryInterface.createTable('playlists', {
id: {
allowNull: false,
autoIncrement: true,
@@ -29,6 +29,6 @@ module.exports = {
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('userPlaylists');
await queryInterface.dropTable('playlists');
}
};

View File

@@ -0,0 +1,34 @@
'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('links', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
userID: {
type: Sequelize.STRING
},
from: {
type: Sequelize.STRING
},
to: {
type: Sequelize.STRING
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('links');
}
};