mirror of https://github.com/pressly/goose.git
postgres: update table to use identity instead of serial (#694)
parent
3802b0ad2d
commit
3d6ee770a7
|
@ -8,11 +8,10 @@ var _ Querier = (*Postgres)(nil)
|
|||
|
||||
func (p *Postgres) CreateTable(tableName string) string {
|
||||
q := `CREATE TABLE %s (
|
||||
id serial NOT NULL,
|
||||
id integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
|
||||
version_id bigint NOT NULL,
|
||||
is_applied boolean NOT NULL,
|
||||
tstamp timestamp NULL default now(),
|
||||
PRIMARY KEY(id)
|
||||
tstamp timestamp NOT NULL DEFAULT now()
|
||||
)`
|
||||
return fmt.Sprintf(q, tableName)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue