dialects/postgres.go aktualisiert
Fix migrations for cocktoachdb not working because of recreation of tables that are defined with "pk autoincr". Cockroach only creates the rowid with default unique_rowid() when no pk is defined. Signed-off-by: LNAhri <lnahri@noreply.gitea.com>
This commit is contained in:
parent
7654b7b749
commit
b6b451420b
|
@ -1145,7 +1145,11 @@ WHERE n.nspname= s.table_schema AND c.relkind = 'r' AND c.relname = $1%s AND f.a
|
|||
}
|
||||
|
||||
if colDefault != nil && *colDefault == "unique_rowid()" { // ignore the system column added by cockroach
|
||||
continue
|
||||
if colName == "rowid" { // but only skip if the name is also rowid therefore allowing custom primary keys columns and don't recreate tables defined with with pk autoincr
|
||||
continue
|
||||
}
|
||||
te := ""
|
||||
colDefault = &te
|
||||
}
|
||||
|
||||
col.Name = strings.Trim(colName, `" `)
|
||||
|
|
Loading…
Reference in New Issue