Use SQL timestamp instead of time

* Use SQL data type timestamp for users.created and
  repositories.updated since we want to store datetimes, not time of
  day
* Fix :migration-dir in project file

Fixes: #15
This commit is contained in:
Teemu Patja 2017-01-21 18:06:37 +02:00
parent 0be96b26cd
commit 8cb5995d5a
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
3 changed files with 3 additions and 1 deletions

View File

@ -48,7 +48,7 @@
:target-path "target/%s/"
:main commiteth.core
:migratus {:store :database
:migration-dir "resources/migrations"
:migration-dir "migrations"
:db ~(get (System/getenv) "DATABASE_URL")}
:plugins [[lein-cprop "1.0.1"]

View File

@ -0,0 +1,2 @@
ALTER TABLE public.users ALTER COLUMN created SET DATA TYPE timestamp without time zone using date('20170120') + created;
ALTER TABLE public.repositories ALTER COLUMN updated SET DATA TYPE timestamp without time zone using date('20170120') + updated;