mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
feat(migrations/031): create ditto_domains table
This commit is contained in:
parent
135657dbb4
commit
d26709e947
1 changed files with 17 additions and 0 deletions
17
src/db/migrations/031_add_ditto_domains.ts
Normal file
17
src/db/migrations/031_add_ditto_domains.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { Kysely } from 'kysely';
|
||||
|
||||
export async function up(db: Kysely<any>): Promise<void> {
|
||||
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<any>): Promise<void> {
|
||||
await db.schema.dropTable('ditto_domains').execute();
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue