Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

454 B
Raw Blame
import type { Migration } from '../migrations.types';
import { sql } from 'drizzle-orm';

export const kvStoreMigration = {
  name: 'kv-store',

  up: async ({ db }) => {
    await db.run(sql`CREATE TABLE IF NOT EXISTS "kv_store" (
      "key" text PRIMARY KEY NOT NULL,
      "value" text NOT NULL,
      "expires_at" integer
    )`);
  },

  down: async ({ db }) => {
    await db.run(sql`DROP TABLE IF EXISTS "kv_store"`);
  },
} satisfies Migration;