Skip to content

Commit

Permalink
MOTS-269: Rename date columns
Browse files Browse the repository at this point in the history
  • Loading branch information
jkondrat committed Feb 22, 2018
1 parent b5887cb commit 49e6ba8
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 8 deletions.
Empty file added reverse.sql
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
@NoArgsConstructor
public abstract class BaseTimestampedEntity extends BaseEntity {

@Column(name = "create_date")
@Column(name = "created_date")
@CreationTimestamp
@Getter
@Setter
private Date createDate;
private Date createdDate;

@Column(name = "update_date")
@Column(name = "updated_date")
@UpdateTimestamp
@Getter
@Setter
private Date updateDate;
private Date updatedDate;

public BaseTimestampedEntity(UUID id) {
super(id);
Expand Down
139 changes: 139 additions & 0 deletions src/main/resources/db/changelog/20180222_1132.mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
--liquibase formatted sql

--changeset user:1519295578093-2
ALTER TABLE assigned_course CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-3
ALTER TABLE assigned_modules CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-4
ALTER TABLE call_detail_record CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-5
ALTER TABLE call_flow_element CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-6
ALTER TABLE chiefdom CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-7
ALTER TABLE choice CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-8
ALTER TABLE community CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-9
ALTER TABLE community_health_worker CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-10
ALTER TABLE course CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-11
ALTER TABLE district CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-12
ALTER TABLE facility CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-13
ALTER TABLE in_charge CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-14
ALTER TABLE ivr_config CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-15
ALTER TABLE jasper_templates CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-16
ALTER TABLE module CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-17
ALTER TABLE module_progress CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-18
ALTER TABLE question_response CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-19
ALTER TABLE template_parameters CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-20
ALTER TABLE unit CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-21
ALTER TABLE unit_progress CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-22
ALTER TABLE user CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-23
ALTER TABLE user_role CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-24
ALTER TABLE assigned_course CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-25
ALTER TABLE assigned_modules CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-26
ALTER TABLE call_detail_record CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-27
ALTER TABLE call_flow_element CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-28
ALTER TABLE chiefdom CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-29
ALTER TABLE choice CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-30
ALTER TABLE community CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-31
ALTER TABLE community_health_worker CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-32
ALTER TABLE course CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-33
ALTER TABLE district CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-34
ALTER TABLE facility CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-35
ALTER TABLE in_charge CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-36
ALTER TABLE ivr_config CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-37
ALTER TABLE jasper_templates CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-38
ALTER TABLE module CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-39
ALTER TABLE module_progress CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-40
ALTER TABLE question_response CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-41
ALTER TABLE template_parameters CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-42
ALTER TABLE unit CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-43
ALTER TABLE unit_progress CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-44
ALTER TABLE user CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-45
ALTER TABLE user_role CHANGE update_date updated_date datetime NULL;

--changeset user:1519295578093-46
ALTER TABLE district_assignment_log CHANGE create_date created_date datetime NULL;

--changeset user:1519295578093-47
ALTER TABLE district_assignment_log CHANGE update_date updated_date datetime NULL;
1 change: 1 addition & 0 deletions src/main/resources/db/changelog/liquibase-changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@
<include file="20180219_1827.mysql.sql" relativeToChangelogFile="true" />
<include file="20180221_185012_insert_chw_training_module.sql" relativeToChangelogFile="true" />
<include file="20180221_1701.mysql.sql" relativeToChangelogFile="true" />
<include file="20180222_1132.mysql.sql" relativeToChangelogFile="true" />
</databaseChangeLog>
2 changes: 1 addition & 1 deletion src/main/resources/test_ivr_config.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
INSERT INTO `ivr_config` (`id`, `create_date`, `update_date`, `name`, `base_url`, `default_users_group_id`, `detect_voicemail_action`, `module_assigned_message_id`, `retry_attempts_long`, `retry_attempts_short`, `retry_delay_long`, `retry_delay_short`, `send_sms_if_voice_fails`, `call_id_field`, `chw_ivr_id_field`, `call_log_id_field`, `call_status_field`, `voto_main_tree_id`)
INSERT INTO `ivr_config` (`id`, `created_date`, `updated_date`, `name`, `base_url`, `default_users_group_id`, `detect_voicemail_action`, `module_assigned_message_id`, `retry_attempts_long`, `retry_attempts_short`, `retry_delay_long`, `retry_delay_short`, `send_sms_if_voice_fails`, `call_id_field`, `chw_ivr_id_field`, `call_log_id_field`, `call_status_field`, `voto_main_tree_id`)
VALUES ('70638cc4-4c33-4899-8480-a4ef1607273b', '2018-02-15 16:07:22.745000', '2018-02-15 16:07:22.745000', 'Voto', 'https://go.votomobile.org/api/v1', '298868', true, '2228099', 1, 3, 60, 15, true, 'outgoing_call_id', 'subscriber_id', 'delivery_log_id', 'delivery_status', '22047');

INSERT INTO `mots`.`ivr_config_languages` (`ivr_config_id`, `ivr_language_id`, `language`) VALUES ('70638cc4-4c33-4899-8480-a4ef1607273b', '206945', 'ENGLISH');
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/test_modules.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ INSERT INTO `multiple_choice_question` (`call_flow_element_id`) VALUES ('03f8f5a
INSERT INTO `multiple_choice_question` (`call_flow_element_id`) VALUES ('03ff01a2-b413-4b19-b5e2-e3dcc652583b');
INSERT INTO `multiple_choice_question` (`call_flow_element_id`) VALUES ('04ea4726-2aef-459a-8a34-8ccd12613396');

INSERT INTO `module` (`id`,`create_date`,`update_date`,`ivr_id`,`ivr_name`,`description`,`module_number`,`name`,`status`,`version`,`previous_version_id`,`start_module_question_id`,`name_code`,`ivr_group`,`course_id`) VALUES ('2dcaa2da-edc4-42b0-a505-167d327aaf06','2017-11-14 16:07:22.745000','2017-11-14 16:07:22.745000','20229','module1',NULL,1,'Module 1','RELEASED',1,NULL,'03f8f5a7-045e-4810-ac4e-30d2beda82ae','module-1_v1','298829','d5c4a806-f817-47e3-b73d-8803a7e76ddd');
INSERT INTO `module` (`id`,`create_date`,`update_date`,`ivr_id`,`ivr_name`,`description`,`module_number`,`name`,`status`,`version`,`previous_version_id`,`start_module_question_id`,`name_code`,`ivr_group`,`course_id`) VALUES ('3ccbb0b8-0e5a-4e97-9bb2-8b934e12777d','2017-11-14 16:07:22.770000','2017-11-14 16:07:22.770000','20230','module2',NULL,2,'Module 2','RELEASED',1,NULL,'03ff01a2-b413-4b19-b5e2-e3dcc652583b','module-2_v1','298830','d5c4a806-f817-47e3-b73d-8803a7e76ddd');
INSERT INTO `module` (`id`,`create_date`,`update_date`,`ivr_id`,`ivr_name`,`description`,`module_number`,`name`,`status`,`version`,`previous_version_id`,`start_module_question_id`,`name_code`,`ivr_group`,`course_id`) VALUES ('766eb0c6-da6b-43e5-8b6b-eff89e58223f','2017-11-14 16:07:22.777000','2017-11-14 16:07:22.777000','20231','module3',NULL,3,'Module 3','RELEASED',1,NULL,'04ea4726-2aef-459a-8a34-8ccd12613396','module-3_v1','298831','d5c4a806-f817-47e3-b73d-8803a7e76ddd');
INSERT INTO `module` (`id`,`created_date`,`updated_date`,`ivr_id`,`ivr_name`,`description`,`module_number`,`name`,`status`,`version`,`previous_version_id`,`start_module_question_id`,`name_code`,`ivr_group`,`course_id`) VALUES ('2dcaa2da-edc4-42b0-a505-167d327aaf06','2017-11-14 16:07:22.745000','2017-11-14 16:07:22.745000','20229','module1',NULL,1,'Module 1','RELEASED',1,NULL,'03f8f5a7-045e-4810-ac4e-30d2beda82ae','module-1_v1','298829','d5c4a806-f817-47e3-b73d-8803a7e76ddd');
INSERT INTO `module` (`id`,`created_date`,`updated_date`,`ivr_id`,`ivr_name`,`description`,`module_number`,`name`,`status`,`version`,`previous_version_id`,`start_module_question_id`,`name_code`,`ivr_group`,`course_id`) VALUES ('3ccbb0b8-0e5a-4e97-9bb2-8b934e12777d','2017-11-14 16:07:22.770000','2017-11-14 16:07:22.770000','20230','module2',NULL,2,'Module 2','RELEASED',1,NULL,'03ff01a2-b413-4b19-b5e2-e3dcc652583b','module-2_v1','298830','d5c4a806-f817-47e3-b73d-8803a7e76ddd');
INSERT INTO `module` (`id`,`created_date`,`updated_date`,`ivr_id`,`ivr_name`,`description`,`module_number`,`name`,`status`,`version`,`previous_version_id`,`start_module_question_id`,`name_code`,`ivr_group`,`course_id`) VALUES ('766eb0c6-da6b-43e5-8b6b-eff89e58223f','2017-11-14 16:07:22.777000','2017-11-14 16:07:22.777000','20231','module3',NULL,3,'Module 3','RELEASED',1,NULL,'04ea4726-2aef-459a-8a34-8ccd12613396','module-3_v1','298831','d5c4a806-f817-47e3-b73d-8803a7e76ddd');

0 comments on commit 49e6ba8

Please sign in to comment.