You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 32f49e3
Browse filesBrowse the repository at this point in the historyBrowse files
expect(awaitsql`SELECT to_regclass('public.project_workspace') AS connector`).toEqual([
539
+
{connector: null},
540
+
])
541
+
expect(
542
+
awaitsql`SELECT attnotnull FROM pg_attribute WHERE attrelid = 'public.workspace'::regclass AND attname = 'project_id'`
543
+
).toEqual([{attnotnull: true}])
544
+
expect(
545
+
awaitsql`SELECT count(*)::int AS count FROM pg_trigger WHERE tgrelid IN ('public.workspace'::regclass,'public.project'::regclass) AND tgname IN ('project_contract_lock','project_contract_check')`
546
+
).toEqual([{count: 4}])
547
+
expect(awaitscoped`SELECT id,project_id FROM workspace`).toEqual([
548
+
{id: 'shadow',project_id: null},
549
+
])
550
+
expect(
551
+
awaitsql`SELECT to_regclass('shadow.project_workspace') IS NOT NULL AS retained`
552
+
).toEqual([{retained: true}])
553
+
expect(
554
+
awaitsql`SELECT attnotnull FROM pg_attribute WHERE attrelid = 'shadow.workspace'::regclass AND attname = 'project_id'`
555
+
).toEqual([{attnotnull: false}])
556
+
expect(
557
+
awaitsql`SELECT count(*)::int AS count FROM pg_trigger WHERE tgrelid IN ('shadow.workspace'::regclass,'shadow.project'::regclass) AND NOT tgisinternal`
558
+
).toEqual([{count: 0}])
559
+
awaitscoped`UPDATE public.workspace SET name = 'Updated' WHERE id = 'env'`
560
+
awaitexpect(
561
+
scoped`UPDATE public.workspace SET archived_at = now() WHERE id = 'env'`
562
+
).rejects.toMatchObject({code: '23514'})
563
+
expect(awaitsql`SELECT name,archived_at FROM public.workspace`).toEqual([
564
+
{name: 'Updated',archived_at: null},
565
+
])
566
+
}finally{
567
+
awaitscoped.end({timeout: 2})
568
+
}
569
+
})
570
+
})
571
+
522
572
it('requires completed assignments before final enforcement and leaves missing assignments untouched',async()=>{
523
573
awaitdatabase(async(sql)=>{
524
574
awaitsql`INSERT INTO workspace (id,name,owner_id) VALUES ('legacy','Legacy','owner')`
0 commit comments