mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 14:43:24 +00:00
fix: "cannot remove collection" related to unused stuff
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { BaseSchema } from '@adonisjs/lucid/schema';
|
||||
|
||||
export default class extends BaseSchema {
|
||||
protected tableName = 'collections';
|
||||
|
||||
async up() {
|
||||
this.schema.alterTable('collections', (table) => {
|
||||
table.dropColumn('next_id');
|
||||
});
|
||||
}
|
||||
|
||||
async down() {
|
||||
this.schema.alterTable('collections', (table) => {
|
||||
table
|
||||
.integer('next_id')
|
||||
.references('id')
|
||||
.inTable('collections')
|
||||
.defaultTo(null);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,6 @@ function createRandomCollection(userIds: User['id'][]) {
|
||||
name: faker.string.alphanumeric({ length: { min: 5, max: 25 } }),
|
||||
description: faker.string.alphanumeric({ length: { min: 0, max: 254 } }),
|
||||
visibility: Visibility.PRIVATE,
|
||||
nextId: collectionId + 1,
|
||||
authorId,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user