mirror of
https://github.com/20kaushik02/spotify-manager.git
synced 2026-01-25 06:04:05 +00:00
link creation/deletion
This commit is contained in:
@@ -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');
|
||||
}
|
||||
};
|
||||
34
migrations/20240730101615-create-links.js
Normal file
34
migrations/20240730101615-create-links.js
Normal 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');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user