postgres: update table to use identity instead of serial (#694)

pull/814/head
Michael Fridman 2024-08-27 18:50:49 -04:00 committed by GitHub
parent 3802b0ad2d
commit 3d6ee770a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -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)
}