Skip to content

Commit

Permalink
adjust migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
elvece committed Nov 2, 2024
1 parent 5790154 commit 42bbd03
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 41 deletions.
30 changes: 0 additions & 30 deletions scripts/migrations/2_0_0_1_down_migration.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { types as T, matches } from "../deps.ts";

const { shape, string } = matches;

export const migration_up_2_0_0_1 = (config: T.Config): T.Config => {
export const migration_up_2_0_0 = (config: T.Config): T.Config => {
if (Object.keys(config).length === 0) {
// service was never configured
return config;
Expand Down
16 changes: 6 additions & 10 deletions scripts/procedures/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { types as T, compat } from "../deps.ts";
import { migration_up_1_4_7 } from "../migrations/1_4_7_up_migration.ts";
import { migration_down_1_4_7 } from "../migrations/1_4_7_down_migration.ts";
import { migration_up_1_10_3 } from "../migrations/1_10_3_up_migration.ts";
import { migration_up_2_0_0_1 } from "../migrations/2_0_0_1_up_migration.ts";
import { migration_down_2_0_0_1 } from "../migrations/2_0_0_1_down_migration.ts";
import { migration_up_2_0_0 } from "../migrations/2_0_0_up_migration.ts";

export const migration: T.ExpectedExports.migration = async (
effects,
Expand Down Expand Up @@ -42,18 +41,15 @@ export const migration: T.ExpectedExports.migration = async (
true,
{ version: "1.10.2", type: "up" }
),
down: compat.migrations.updateConfig(
(_config) => {
throw new Error("Cannot downgrade this version");
},
true,
{ version: "1.10.2", type: "down" }
),
down: () => {
throw new Error("Cannot downgrade this version");
},
},
// major release incompatible downgrade, adds monero
"2.0.0": {
up: compat.migrations.updateConfig(
(config) => {
return migration_up_2_0_0_1(config);
return migration_up_2_0_0(config);
},
true,
{ version: "2.0.0", type: "up" }
Expand Down

0 comments on commit 42bbd03

Please sign in to comment.