You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using persistent with PostgreSQL and having the following definition
createdAt UTCTime "sqltype=timestamp without time zone" default=now()
causes a
Migrating: ALTER TABLE "memberships" ALTER COLUMN "created_at" TYPE timestamp without time zone
every time the migrations are run. The type of the field in the DB is set correctly the first time, I would expect it not to issue an ALTER statement every time.
Is this a (quoting?) problem with my field definition or is persistent not getting the correct column type when calculating the necessary migrations?
The text was updated successfully, but these errors were encountered:
It turns out in PostgreSQL timestamp and timestamp without time zone are synonyms and the udt_name of such a column is reported simply as timestamp, see first note on http://www.postgresql.org/docs/current/static/datatype-datetime.html. So one option is to define the sqltype= as timestamp, the other is to add an alias in sqlShowType such as
showSqlType (SqlOther (T.toLower -> "timestamp")) = "TIMESTAMP WITHOUT TIME ZONE"
It turns out in PostgreSQL timestamp and timestamp without time zone are
synonyms and the udt_name of such a column is reported simply as timestamp,
see first note on http://www.postgresql.org/docs/current/static/datatype-datetime.html. So
one option is to define the sqltype= as timestamp, the other is to add an
alias in sqlShowType such as
showSqlType (SqlOther (T.toLower -> "timestamp")) = "TIMESTAMP WITHOUT TIME ZONE"
in Database.Persist.Postgresql.
—
Reply to this email directly or view it on GitHub #514 (comment)
.
When using persistent with PostgreSQL and having the following definition
causes a
every time the migrations are run. The type of the field in the DB is set correctly the first time, I would expect it not to issue an
ALTER
statement every time.Is this a (quoting?) problem with my field definition or is persistent not getting the correct column type when calculating the necessary migrations?
The text was updated successfully, but these errors were encountered: