diff --git a/src/db/migrations/031_add_ditto_domains.ts b/src/db/migrations/031_add_ditto_domains.ts new file mode 100644 index 00000000..3b55f6de --- /dev/null +++ b/src/db/migrations/031_add_ditto_domains.ts @@ -0,0 +1,17 @@ +import { Kysely } from 'kysely'; + +export async function up(db: Kysely): Promise { + await db.schema + .createTable('ditto_domains') + .addColumn('domain', 'text', (col) => col.primaryKey()) + .addColumn('title', 'text', (col) => col.notNull()) + .addColumn('description', 'text', (col) => col.notNull()) + .addColumn('categories', 'jsonb', (col) => col.notNull()) + .addColumn('image', 'text', (col) => col.notNull()) + .addColumn('total_users', 'integer', (col) => col.notNull()) + .execute(); +} + +export async function down(db: Kysely): Promise { + await db.schema.dropTable('ditto_domains').execute(); +}