Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

354 B
Raw Blame
import { Migration, sql } from 'kysely';

export const addCreatedAtIndexToUploads: Migration = {
  up: async (db) => {
    await sql`CREATE INDEX uploads_created_at_idx ON uploads (created_at) WHERE uploaded_at IS NULL`.execute(
      db
    );
  },
  down: async (db) => {
    await sql`DROP INDEX IF EXISTS uploads_created_at_idx`.execute(db);
  },
};