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,8 +1145,12 @@ 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
|
if colDefault != nil && *colDefault == "unique_rowid()" { // ignore the system column added by cockroach
|
||||||
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
te := ""
|
||||||
|
colDefault = &te
|
||||||
|
}
|
||||||
|
|
||||||
col.Name = strings.Trim(colName, `" `)
|
col.Name = strings.Trim(colName, `" `)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue