Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions apps/host-cloudflare/src/db/data-migrations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,6 @@ const insertOperationStorage = (
});

describe("runCloudflareDataMigrations", () => {
it.effect("adds the OAuth client token endpoint authentication method column", () =>
Effect.gen(function* () {
const db = yield* Effect.promise(() => createSqliteTestFumaDb({ tables: collectTables() }));
const { bucket } = makeFakeR2();

yield* Effect.promise(() =>
db.client.execute("ALTER TABLE oauth_client DROP COLUMN token_endpoint_auth_method"),
);

const d1 = makeFakeD1(db.client);
yield* Effect.promise(() => runCloudflareDataMigrations(d1, bucket));

const columns = yield* Effect.promise(() =>
db.client.execute("PRAGMA table_info('oauth_client')"),
);
expect(columns.rows.map((row) => row.name)).toContain("token_endpoint_auth_method");
}),
);

it.effect("rebuilds legacy connection tables from item_id to item_ids", () =>
Effect.gen(function* () {
const db = yield* Effect.promise(() => createSqliteTestFumaDb({ tables: collectTables() }));
Expand Down
5 changes: 0 additions & 5 deletions apps/host-cloudflare/src/db/data-migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ export const ensureCloudflareD1SchemaCompatibility = async (db: D1Database): Pro
.run();
}

const oauthClientColumns = await tableColumns(db, "oauth_client");
if (oauthClientColumns.size > 0 && !oauthClientColumns.has("token_endpoint_auth_method")) {
await db.prepare(`ALTER TABLE oauth_client ADD COLUMN token_endpoint_auth_method text`).run();
}

const connectionColumns = await tableColumns(db, "connection");
if (connectionColumns.size === 0) return schemaChanged;
if (!connectionColumns.has("item_ids")) {
Expand Down