feat(workspaces): apply prepared transactions to workspaces (#5383)

* feat(multiregion): replace user replication

* chore(multiregion): optimise replication

* maybe it's this

* postgres is fun

* once more

* chore(multiregion): only replicate test user creation during multiregion tests

* feat: improved replicate_query logic

* fix: minor

* fix: starting issue

* feat: included user create and delete specs to multiregion

* feat: removed console logs

* fix: user defaults

* fix: multiregion test helper

* fix: update scenarios for users

* refactor(multiregion): swap replicateQuery concept to asMultiregionOperation (#5301)

feat(multiregion): introduced asMultregionOperator, refactor test to user builder classes

* chore: renamings

* fix: remove comments

* feat: remove user replication

* refactor: simplified spec usages

* chore: comments

* chore: branches and favs

* chore: more tests

* chore: more tests

* fix linting

* fix tests

* feat: dropping replication

* refactor: moved project delete to service

* fix: comment

* feat: updateStreamFactory and updateProjectFacotry

* deleteProjectFactory + replicateFactory

* deleteWorkspaceFactory

* fix: selector

* fix: tests

* fix tests, finished createStreamFactory

* feat: simplify changes

* fix: remove comment

* fix: minor strucutres

* fix: moveProjectToRegion

* fix: moved branch creation outside of multiregion scope

* fix: branch creation

* fix: tests

* fix: ci tests

* fix: removed log form test

* fix: on specs, no random regionKeys

* review fixes

* feat: workspace replciation

* fix: mr comments

* feat: removed test

* fix: worksapce test creation

* fix: mr issues

* updated mutations

* feat: drop workspace random defaults

---------

Co-authored-by: Charles Driesler <chuck@speckle.systems>
This commit is contained in:
Daniel Gak Anagrov
2025-09-11 09:08:26 +01:00
committed by GitHub
parent f9b276548e
commit 2c122a138d
13 changed files with 231 additions and 176 deletions
@@ -0,0 +1,20 @@
import type { Knex } from 'knex'
const tableName = 'workspaces'
const colSlug = 'slug'
export async function up(knex: Knex): Promise<void> {
await knex.schema.raw(`
ALTER TABLE "${tableName}"
ALTER COLUMN "${colSlug}" DROP DEFAULT;
`)
}
export async function down(knex: Knex): Promise<void> {
await knex.schema.alterTable(tableName, (table) => {
table
.string(colSlug)
.defaultTo(knex.raw('substring(md5(random()::text), 0, 15)'))
.alter()
})
}