Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
@ -1,31 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.createTable('files', {
|
||||
id: {
|
||||
allowNull: false,
|
||||
primaryKey: true,
|
||||
type: Sequelize.UUID,
|
||||
defaultValue: Sequelize.UUIDV4
|
||||
},
|
||||
name: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
url: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
}
|
||||
});
|
||||
},
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.dropTable('files');
|
||||
}
|
||||
};
|
||||
@ -1,23 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.addColumn('files', 'belongsTo', {
|
||||
type: Sequelize.STRING(255),
|
||||
allowNull: true,
|
||||
});
|
||||
await queryInterface.addColumn('files', 'belongsToId', {
|
||||
type: Sequelize.UUID,
|
||||
allowNull: true,
|
||||
});
|
||||
await queryInterface.addColumn('files', 'belongsToColumn', {
|
||||
type: Sequelize.STRING(255),
|
||||
allowNull: true,
|
||||
});
|
||||
},
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.removeColumn('files', 'belongsTo');
|
||||
await queryInterface.removeColumn('files', 'belongsToId');
|
||||
await queryInterface.removeColumn('files', 'belongsToColumn');
|
||||
}
|
||||
};
|
||||
@ -1,14 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.addColumn('files', 'sizeInBytes', {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: true,
|
||||
});
|
||||
},
|
||||
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.removeColumn('files', 'sizeInBytes');
|
||||
}
|
||||
};
|
||||
@ -1,14 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
return queryInterface.addColumn('files', 'privateUrl', {
|
||||
type: Sequelize.STRING,
|
||||
allowNull: true,
|
||||
});
|
||||
},
|
||||
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
return queryInterface.removeColumn('files', 'privateUrl');
|
||||
}
|
||||
};
|
||||
@ -1,18 +0,0 @@
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
const tableInfo = await queryInterface.describeTable('files');
|
||||
if (!tableInfo.publicUrl) {
|
||||
await queryInterface.addColumn('files', 'publicUrl', {
|
||||
type: Sequelize.STRING(2083),
|
||||
allowNull: false,
|
||||
defaultValue: '',
|
||||
});
|
||||
}
|
||||
},
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
const tableInfo = await queryInterface.describeTable('files');
|
||||
if (tableInfo.publicUrl) {
|
||||
await queryInterface.removeColumn('files', 'publicUrl');
|
||||
}
|
||||
},
|
||||
};
|
||||
@ -1,16 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
const tableInfo = await queryInterface.describeTable('files');
|
||||
if (!tableInfo.deletedAt) {
|
||||
await queryInterface.addColumn('files', 'deletedAt', {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: true,
|
||||
});
|
||||
}
|
||||
},
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.removeColumn('files', 'deletedAt');
|
||||
}
|
||||
};
|
||||
@ -1,22 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
const tableInfo = await queryInterface.describeTable('files');
|
||||
if (!tableInfo.createdById) {
|
||||
await queryInterface.addColumn('files', 'createdById', {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: true,
|
||||
references: {
|
||||
model: 'users',
|
||||
key: 'id'
|
||||
},
|
||||
onUpdate: 'CASCADE',
|
||||
onDelete: 'SET NULL'
|
||||
});
|
||||
}
|
||||
},
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.removeColumn('files', 'createdById');
|
||||
}
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user