From d26709e947ed6b54fcfda0d23f911b0ddd30deed Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Tue, 13 Aug 2024 18:26:45 -0300 Subject: [PATCH] feat(migrations/031): create ditto_domains table --- src/db/migrations/031_add_ditto_domains.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/db/migrations/031_add_ditto_domains.ts 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(); +}