diff --git a/backend/src/db/migrations/20240202093209_ghost_user.ts b/backend/src/db/migrations/20240202093209_ghost_user.ts deleted file mode 100644 index ddfdbe812..000000000 --- a/backend/src/db/migrations/20240202093209_ghost_user.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Knex } from "knex"; - -import { ProjectVersion, TableName } from "../schemas"; - -export async function up(knex: Knex): Promise { - const hasGhostUserColumn = await knex.schema.hasColumn(TableName.Users, "ghost"); - const hasProjectVersionColumn = await knex.schema.hasColumn(TableName.Project, "version"); - - if (!hasGhostUserColumn) { - await knex.schema.alterTable(TableName.Users, (t) => { - t.boolean("ghost").defaultTo(false).notNullable(); - }); - } - - if (!hasProjectVersionColumn) { - await knex.schema.alterTable(TableName.Project, (t) => { - t.string("version").defaultTo(ProjectVersion.V1).notNullable(); - t.text("upgradeStatus").nullable(); - }); - } -} - -export async function down(knex: Knex): Promise { - const hasGhostUserColumn = await knex.schema.hasColumn(TableName.Users, "ghost"); - const hasProjectVersionColumn = await knex.schema.hasColumn(TableName.Project, "version"); - - if (hasGhostUserColumn) { - await knex.schema.alterTable(TableName.Users, (t) => { - t.dropColumn("ghost"); - }); - } - - if (hasProjectVersionColumn) { - await knex.schema.alterTable(TableName.Project, (t) => { - t.dropColumn("version"); - t.dropColumn("upgradeStatus"); - }); - } -}