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
Copy file name to clipboardExpand all lines: README.md
+24-24
Original file line number
Diff line number
Diff line change
@@ -44,47 +44,47 @@ Well, it's easy:
44
44
45
45
1. So we're going to rename a table
46
46
* Rename the `inv` table to `invoice`
47
-
* Rename the `lineitem` table to `line\_item`
48
-
* Rename the `lidetail` table to `line\_item\_detail`
49
-
1. Rename some columns in the `invoice` table
47
+
* Rename the `lineitem` table to `line_item`
48
+
* Rename the `lidetail` table to `line_item_detail`
49
+
2. Rename some columns in the `invoice` table
50
50
* Rename `invid` to `id`
51
-
* Rename `invnumber` to `invoice\_number`
52
-
* Rename `datetimecreated` to `date\_created`
53
-
1. We're going to combine two columns using data transformation
54
-
* `invoice.udtime` and `invoice.uddate` should be combined into `invoice.date\_updated`
55
-
* First populate the `date\_created` new column with an `UPDATE` query that merges the `udtime` and `uddate` values
51
+
* Rename `invnumber` to `invoice_number`
52
+
* Rename `datetimecreated` to `date_created`
53
+
3. We're going to combine two columns using data transformation
54
+
* `invoice.udtime` and `invoice.uddate` should be combined into `invoice.date_updated`
55
+
* First populate the `date_created` new column with an `UPDATE` query that merges the `udtime` and `uddate` values
56
56
* HINT: `udtime` + `uddate`
57
57
* What do you think about this refactoring?
58
58
* drop or kept them?
59
-
1. Create tables
60
-
* `contact\_ball\_of\_mud` is too ambitious of a table (or insufficiently coherent). Let's begin splitting it up.
59
+
4. Create tables
60
+
* `contact_ball_of_mud` is too ambitious of a table (or insufficiently coherent). Let's begin splitting it up.
61
61
* The **contact** table should contain name fields, gender, email address, street address, birthday, occupation, and national ID
62
-
* The **security\_info** table should contain password and mother's maiden name
63
-
* The **credit\_card** table should contain credit card type, number, expiration and CVV
62
+
* The **security_info** table should contain password and mother's maiden name
63
+
* The **credit_card** table should contain credit card type, number, expiration and CVV
64
64
* Choice of data type for each column is left as an exercise for the student.
65
65
* Don't run this refactoring yet!
66
-
1. Tagging and rolling back
66
+
5. Tagging and rolling back
67
67
* Tag the database, then run the table rename refactoring written in the previous step
68
68
* Now roll back to continue development on the refactoring
69
-
1. Finish refactoring of `contact\_ball\_of\_mud`
69
+
6. Finish refactoring of `contact_ball_of_mud`
70
70
* Write data transformation code to populate the three tables from their source
71
-
* Remember that `security\_info` and `credit\_card` should have foreign keys to contact. Be sure to add these constraints with the appropriate refactorings
72
-
1. Add a column
73
-
* Add a `full\_name` column to contact
71
+
* Remember that `security_info` and `credit_card` should have foreign keys to contact. Be sure to add these constraints with the appropriate refactorings
72
+
7. Add a column
73
+
* Add a `full_name` column to contact
74
74
* Write data transformation SQL to populate it with the three existing name fields combined
75
75
* HINT: `CONCAT_WS()`
76
76
* Don't drop of the source name columns.
77
-
1. Create a trigger
78
-
* Create a file called __contact\_insert.sql__
79
-
* Write trigger logic to keep `full\_name` up to date with the fields for first name, middle initial, and last name every time a new record is inserted
80
-
* Create a file called *contact\_update.sql*
77
+
8. Create a trigger
78
+
* Create a file called __contact_insert.sql__
79
+
* Write trigger logic to keep `full_name` up to date with the fields for first name, middle initial, and last name every time a new record is inserted
80
+
* Create a file called *contact_update.sql*
81
81
* Same logic as the insert trigger
82
82
* Write changeSets that use the sqlFile refactoring to install these triggers.
83
83
* Remember the runOnChange attribute.
84
84
* HINT: be sure the changeSet is idempotent!
85
-
1. Use **gradle**, this is the thing that you should to do...
85
+
9. Use **gradle**, this is the thing that you should to do...
86
86
* Restart the steps but now with gradle
87
87
* Use the Groovy DSL for the new migrations
88
-
1. Introduce surrogate key
89
-
* Add an auto\-incrementing column to line\_item called id.
88
+
10. Introduce surrogate key
89
+
* Add an auto\-incrementing column to line_item called id.
0 commit comments