feat(workspaces): add repository function implementations
Co-authored-by: Charles Driesler <chuck@speckle.systems>
This commit is contained in:
@@ -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')
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user