Skip to content

Commit

Permalink
frienships migration
Browse files Browse the repository at this point in the history
  • Loading branch information
lauti7 committed Apr 4, 2024
1 parent 7e220fd commit 9042a74
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/migrations/1712167263170_friendships-table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions, PgType } from 'node-pg-migrate'

export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.createTable('friendships', {
id: {
type: PgType.UUID,
primaryKey: true
},
address_requester: {
type: PgType.VARCHAR,
notNull: true
},
address_requested: {
type: PgType.VARCHAR,
notNull: true
}
})
}

export async function down(pgm: MigrationBuilder): Promise<void> {
pgm.dropTable('friendships')
}

0 comments on commit 9042a74

Please sign in to comment.