Skip to content

Commit

Permalink
Drop ON UPDATE CURRENT_TIMESTAMP(6) from non-null TIMESTAMP columns
Browse files Browse the repository at this point in the history
Fixes #283
  • Loading branch information
Alberto Brigandì authored and alberto-brigandi committed Nov 1, 2018
1 parent 2e08a7f commit 7f2e963
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
databaseChangeLog:
- changeSet:
id: 0003_orchestrator-mysql-timestamp-default-value-2101
author: a.brigandi
comment: >
Set the default value as CURRENT_TIMESTAMP(6) for non-nullable TIMESTAMP columns in MySql.
This is needed to fix the default behaviour of MySql of appending
ON UPDATE CURRENT_TIMESTAMP(6) in the default value of non-nullable TIMESTAMP columns
changes:
- sql:
dbms: mysql
sql: >
ALTER TABLE `deployment`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)
- sql:
dbms: mysql
sql: >
ALTER TABLE `resource`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)
- sql:
dbms: mysql
sql: >
ALTER TABLE `oidc_refresh_token`
CHANGE COLUMN `issued_at` `issued_at` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ databaseChangeLog:
- include:
- file: 0002_orchestrator-create-2001.yaml
relativeToChangelogFile: true
- include:
- file: 0003_orchestrator-mysql-timestamp-default-value-2101.yaml
relativeToChangelogFile: true

0 comments on commit 7f2e963

Please sign in to comment.