mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-30 05:29:25 +02:00
Removes the InstalledTier model and instead checks presence of files on-the-fly. Avoid broken state by handling on the server-side vs. marking as installed by client-side API call
20 lines
583 B
TypeScript
20 lines
583 B
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
|
export default class extends BaseSchema {
|
|
protected tableName = 'installed_tiers'
|
|
|
|
async up() {
|
|
this.schema.dropTableIfExists(this.tableName)
|
|
}
|
|
|
|
async down() {
|
|
// Recreate the table if we need to rollback
|
|
this.schema.createTable(this.tableName, (table) => {
|
|
table.increments('id')
|
|
table.string('category_slug').notNullable().unique()
|
|
table.string('tier_slug').notNullable()
|
|
table.timestamp('created_at', { useTz: true })
|
|
table.timestamp('updated_at', { useTz: true })
|
|
})
|
|
}
|
|
} |