Permalink
Browse files

Tweaks to migrations based on real-world testing

  • Loading branch information...
brycekahle committed Feb 2, 2018
1 parent d514884 commit 6f44e84a9c79e656671848a72c595281129c7bbf
@@ -15,8 +15,8 @@ CREATE TABLE IF NOT EXISTS `{{ index .Options "Namespace" }}users` (
`email_change` varchar(255) DEFAULT NULL,
`email_change_sent_at` timestamp NULL DEFAULT NULL,
`last_sign_in_at` timestamp NULL DEFAULT NULL,
`raw_app_meta_data` varchar(255) DEFAULT NULL,
`raw_user_meta_data` varchar(255) DEFAULT NULL,
`raw_app_meta_data` text DEFAULT NULL,
`raw_user_meta_data` text DEFAULT NULL,
`is_super_admin` tinyint(1) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
@@ -1,3 +1,3 @@
ALTER TABLE `{{ index .Options "Namespace" }}users`
CHANGE COLUMN `raw_app_meta_data` `raw_app_meta_data` varchar(255) DEFAULT NULL ,
CHANGE COLUMN `raw_user_meta_data` `raw_user_meta_data` varchar(255) DEFAULT NULL ;
CHANGE COLUMN `raw_app_meta_data` `raw_app_meta_data` text DEFAULT NULL ,
CHANGE COLUMN `raw_user_meta_data` `raw_user_meta_data` text DEFAULT NULL ;
@@ -1 +1,2 @@
ALTER TABLE `{{ index .Options "Namespace" }}refresh_tokens` ADD `updated_at` timestamp NULL DEFAULT NULL AFTER `created_at`;
UPDATE `{{ index .Options "Namespace" }}refresh_tokens` SET `updated_at` = `created_at` WHERE `updated_at` IS NULL;

0 comments on commit 6f44e84

Please sign in to comment.