The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 07:30 UTC
[codex] migrate Effect.fn in apps/server/src/persistence/Migrations.ts (#1632)
Co-authored-by: codex <codex@users.noreply.github.com>
Julius Marminge committed
Apr 1, 2026 at 08:44 UTC
3488ca3570060449d3855eeba79a40e1f9938f9c
1 file changed
+14
-13
apps/server/src/persistence/Migrations.ts
+14
-13
@@ -92,19 +92,20 @@ export interface RunMigrationsOptions {
92
*
93
* @returns Effect containing array of executed migrations
94
*/
95
-export const runMigrations = ({ toMigrationInclusive }: RunMigrationsOptions = {}) =>
96
- Effect.gen(function* () {
97
- yield* Effect.log(
98
- toMigrationInclusive === undefined
99
- ? "Running all migrations..."
100
- : `Running migrations 1 through ${toMigrationInclusive}...`,
101
- );
102
- const executedMigrations = yield* run({ loader: makeMigrationLoader(toMigrationInclusive) });
103
- yield* Effect.log("Migrations ran successfully").pipe(
104
- Effect.annotateLogs({ migrations: executedMigrations.map(([id, name]) => `${id}_${name}`) }),
105
- );
106
- return executedMigrations;
107
- });
95
+export const runMigrations = Effect.fn("runMigrations")(function* ({
96
+ toMigrationInclusive,
97
+}: RunMigrationsOptions = {}) {
98
+ yield* Effect.log(
99
+ toMigrationInclusive === undefined
100
+ ? "Running all migrations..."
101
+ : `Running migrations 1 through ${toMigrationInclusive}...`,
102
+ );
103
+ const executedMigrations = yield* run({ loader: makeMigrationLoader(toMigrationInclusive) });
104
+ yield* Effect.log("Migrations ran successfully").pipe(
105
+ Effect.annotateLogs({ migrations: executedMigrations.map(([id, name]) => `${id}_${name}`) }),
106
+ );
107
+ return executedMigrations;
108
+});
109
110
/**
111
* Layer that runs migrations when the layer is built.