feat(workspaces): add repository function implementations

Co-authored-by: Charles Driesler <chuck@speckle.systems>
This commit is contained in:
Gergő Jedlicska
2024-07-04 14:46:48 +02:00
committed by GitHub
parent 8ba0b09f45
commit 28ce7c757c
10 changed files with 201 additions and 27 deletions
@@ -6,9 +6,7 @@ export const WorkspaceEvents = {
export type WorkspaceEvents = (typeof WorkspaceEvents)[keyof typeof WorkspaceEvents]
type WorkspaceCreatedPayload = Workspace & {
createdByUserId: string
}
type WorkspaceCreatedPayload = Workspace
export type WorkspaceEventsPayloads = {
[WorkspaceEvents.Created]: WorkspaceCreatedPayload
@@ -0,0 +1,13 @@
import { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
table.dropColumn('createdByUserId')
})
}
export async function down(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
table.text('createdByUserId').references('id').inTable('users').onDelete('set null')
})
}