Monorepo for Tangled tangled.org

orm: ensure migrations table exist #980

open opened by boltless.me targeting master from sl/spindle-rewrite

create new one if it's missing

Signed-off-by: Seongmin Lee git@boltless.me

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3mckguaketd22
+10
Diff #3
+10
orm/orm.go
··· 20 20 } 21 21 defer tx.Rollback() 22 22 23 + _, err = tx.Exec(` 24 + create table if not exists migrations ( 25 + id integer primary key autoincrement, 26 + name text unique 27 + ); 28 + `) 29 + if err != nil { 30 + return fmt.Errorf("creating migrations table: %w", err) 31 + } 32 + 23 33 var exists bool 24 34 err = tx.QueryRow("select exists (select 1 from migrations where name = ?)", name).Scan(&exists) 25 35 if err != nil {

History

4 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
orm: ensure migrations table exist
2/3 timeout, 1/3 success
expand
no conflicts, ready to merge
expand 0 comments
1 commit
expand
orm: ensure migrations table exist
1/3 failed, 2/3 success
expand
expand 0 comments
1 commit
expand
orm: ensure migrations table exist
1/3 failed, 2/3 success
expand
expand 0 comments
1 commit
expand
orm: ensure migrations table exist
1/3 failed, 2/3 success
expand
expand 0 comments