WEBVTT 1 00:00:02.454 --> 00:00:03.866 In the previous video, 2 00:00:03.866 --> 00:00:07.443 we saw an easy way to check the data in our database tables. 3 00:00:07.443 --> 00:00:08.782 So now what we're gonna do is change 4 00:00:08.782 --> 00:00:12.139 our accounts class to update the balance columns 5 00:00:12.139 --> 00:00:14.425 and instal the transaction details, 6 00:00:14.425 --> 00:00:16.570 which from now on are called history 7 00:00:16.570 --> 00:00:18.684 or are called the history. 8 00:00:18.684 --> 00:00:20.421 So, if we actually run this again, 9 00:00:20.421 --> 00:00:22.695 I know we did run it at the end of the last video, 10 00:00:22.695 --> 00:00:25.096 but if we run it again and see the balance for John there 11 00:00:25.096 --> 00:00:27.760 balance on account John has ten dollars. 12 00:00:27.760 --> 00:00:29.507 Well that's not actually correct. 13 00:00:29.507 --> 00:00:33.674 And if we go over to our database viewer and check that out, 14 00:00:35.547 --> 00:00:37.921 we can see that on the database, 15 00:00:37.921 --> 00:00:41.229 we've got John showing a balance of zero. 16 00:00:41.229 --> 00:00:42.798 So there's a couple things we need to do here 17 00:00:42.798 --> 00:00:45.043 in the deposit and withdrawal methods. 18 00:00:45.043 --> 00:00:48.071 What we need to do is create an entry in the history table. 19 00:00:48.071 --> 00:00:50.571 And I'll just close this down. 20 00:00:53.339 --> 00:00:55.509 So I create an entry in the history table 21 00:00:55.509 --> 00:00:58.106 each time a deposit or withdrawal is made. 22 00:00:58.106 --> 00:00:59.837 And we need to update the account balance 23 00:00:59.837 --> 00:01:02.193 in the accounts table as well. 24 00:01:02.193 --> 00:01:05.917 Now, if one of these updates succeeds but the other fails, 25 00:01:05.917 --> 00:01:08.899 then our database would be in an inconsistent state. 26 00:01:08.899 --> 00:01:11.007 So this is one time when we need to make sure 27 00:01:11.007 --> 00:01:13.011 that all updates are performed 28 00:01:13.011 --> 00:01:15.385 or roll back all the updates. 29 00:01:15.385 --> 00:01:16.858 So I want to start by adding the code 30 00:01:16.858 --> 00:01:19.204 to update the two database tables. 31 00:01:19.204 --> 00:01:21.456 And then we're gonna look at how to cause an error 32 00:01:21.456 --> 00:01:25.090 so that we can roll back the transaction if necessary. 33 00:01:25.090 --> 00:01:28.611 All right, so let's start with the deposit method. 34 00:01:28.611 --> 00:01:31.716 And what we're going to do is remove this line here. 35 00:01:31.716 --> 00:01:32.651 We'll comment it out. 36 00:01:32.651 --> 00:01:33.484 Or actually we'll delete it, 37 00:01:33.484 --> 00:01:36.644 because we're gonna replace it anyway. 38 00:01:36.644 --> 00:01:40.394 And we're going to do: new underscore balance 39 00:01:41.266 --> 00:01:44.516 is equal to self dot underscore balance 40 00:01:46.148 --> 00:01:47.148 plus amount. 41 00:01:49.468 --> 00:01:50.389 And next, we're gonna do: 42 00:01:50.389 --> 00:01:52.306 deposit underscore time 43 00:01:53.877 --> 00:01:55.981 is equal to P-Y-T-Z 44 00:01:55.981 --> 00:01:57.564 dot U-T-C 45 00:01:58.995 --> 00:01:59.995 dot localise 46 00:02:02.165 --> 00:02:05.665 And it's gonna be datetime.datetime.utcnow 47 00:02:08.404 --> 00:02:10.040 parentheses. 48 00:02:10.040 --> 00:02:10.873 And we're getting an error there, 49 00:02:10.873 --> 00:02:12.988 but we'll fix that shortly. 50 00:02:12.988 --> 00:02:15.155 And next line, db.execute. 51 00:02:16.710 --> 00:02:18.627 It's going to be UPDATE 52 00:02:21.285 --> 00:02:22.118 accounts 53 00:02:23.472 --> 00:02:24.389 SET balance 54 00:02:25.599 --> 00:02:27.615 is equal to question mark 55 00:02:27.615 --> 00:02:30.298 WHERE space, and then, in parentheses, 56 00:02:30.298 --> 00:02:32.881 name is equal to question mark. 57 00:02:34.522 --> 00:02:38.011 And then we want to provide new underscore balance. 58 00:02:38.011 --> 00:02:40.054 That's the first parameter. 59 00:02:40.054 --> 00:02:42.721 And the second one is self.name. 60 00:02:44.361 --> 00:02:46.342 Then that's the update for the accounts, 61 00:02:46.342 --> 00:02:48.270 but we also need to insert a new transaction 62 00:02:48.270 --> 00:02:51.288 into the history table: db.execute. 63 00:02:51.288 --> 00:02:54.538 That's going to be INSERT INTO history. 64 00:02:55.929 --> 00:02:58.555 VALUES is going to be three, 65 00:02:58.555 --> 00:03:01.638 so we need three question marks here. 66 00:03:02.997 --> 00:03:04.555 And the three parameters are gonna be 67 00:03:04.555 --> 00:03:07.472 deposit underscore time, self.name, 68 00:03:09.310 --> 00:03:10.977 and then the amount. 69 00:03:13.069 --> 00:03:15.883 And we want a db.commit. 70 00:03:15.883 --> 00:03:18.722 Then self dot underscore balance 71 00:03:18.722 --> 00:03:21.835 is now equal to new underscore balance. 72 00:03:21.835 --> 00:03:25.876 And we can leave the print on line 34 as is. 73 00:03:25.876 --> 00:03:27.799 All right, so what have we actually done here? 74 00:03:27.799 --> 00:03:29.799 Well, we started by calculating the balance 75 00:03:29.799 --> 00:03:32.632 into a variable called new_balance 76 00:03:33.566 --> 00:03:36.071 rather than updating the self dot underscore balance 77 00:03:36.071 --> 00:03:37.640 attribute directly. 78 00:03:37.640 --> 00:03:40.055 And that's because we don't want to update that attribute 79 00:03:40.055 --> 00:03:42.535 if the database transaction fails. 80 00:03:42.535 --> 00:03:44.468 So next we get the time of the transaction. 81 00:03:44.468 --> 00:03:46.524 This is on line 29 here. 82 00:03:46.524 --> 00:03:49.034 And this is exactly the same as the code we used 83 00:03:49.034 --> 00:03:51.454 when we created a list of financial transactions 84 00:03:51.454 --> 00:03:52.928 in the last section. 85 00:03:52.928 --> 00:03:54.812 Now, we've got errors here because we need to import 86 00:03:54.812 --> 00:03:57.250 the datetime and P-Y-T-Z modules. 87 00:03:57.250 --> 00:03:58.387 So let's just go ahead and do that now 88 00:03:58.387 --> 00:04:00.304 to remove those errors. 89 00:04:02.282 --> 00:04:03.615 Import datetime. 90 00:04:04.898 --> 00:04:08.301 And also import P-Y-T-Z. 91 00:04:08.301 --> 00:04:11.112 That fixes that error up as you can see. 92 00:04:11.112 --> 00:04:15.655 And next on line 32 and 33 as you can see here, 93 00:04:15.655 --> 00:04:18.041 we're doing the update to the accounts table. 94 00:04:18.041 --> 00:04:20.640 And then we're doing the insert of the new transaction 95 00:04:20.640 --> 00:04:22.886 into our history table. 96 00:04:22.886 --> 00:04:27.186 And remembering to commit on the next line down here, 97 00:04:27.186 --> 00:04:28.627 line 34. 98 00:04:28.627 --> 00:04:32.322 And finally we're updating our underscore balance attribute 99 00:04:32.322 --> 00:04:35.276 now that the transaction's been completed. 100 00:04:35.276 --> 00:04:36.452 All right, so let's just have a look here. 101 00:04:36.452 --> 00:04:38.285 We can run this again. 102 00:04:39.966 --> 00:04:43.554 And if we have a look at our database, 103 00:04:43.554 --> 00:04:45.223 we've now got John showing a balance 104 00:04:45.223 --> 00:04:47.723 of 10 dollars 30 currently, 105 00:04:47.723 --> 00:04:49.751 bearing in mind that we've updated the deposit method 106 00:04:49.751 --> 00:04:51.001 to update the database, 107 00:04:51.001 --> 00:04:53.809 but we haven't updated the withdrawal method yet. 108 00:04:53.809 --> 00:04:56.835 So we need to actually fix that to get this balance correct. 109 00:04:56.835 --> 00:04:59.249 And if we have a look at our history table, 110 00:04:59.249 --> 00:05:01.913 you can see that it's now correctly showing. 111 00:05:01.913 --> 00:05:02.746 There's a history, 112 00:05:02.746 --> 00:05:05.421 there's now a record for each of the three transactions. 113 00:05:05.421 --> 00:05:08.394 And obviously there's not one for withdrawing yet. 114 00:05:08.394 --> 00:05:10.852 And one thing you can do, 115 00:05:10.852 --> 00:05:13.685 you can actually drag these tables 116 00:05:15.421 --> 00:05:17.231 and put them somewhere else. 117 00:05:17.231 --> 00:05:18.527 And it's a little bit hard for me to do 118 00:05:18.527 --> 00:05:19.695 because I'm actually in full screen. 119 00:05:19.695 --> 00:05:21.082 So I won't do it now. 120 00:05:21.082 --> 00:05:22.997 But with the accounts and history table, 121 00:05:22.997 --> 00:05:25.544 we can actually drag those off the tab bar 122 00:05:25.544 --> 00:05:28.190 so that you can view the two tables side by side. 123 00:05:28.190 --> 00:05:31.840 And remember to refresh the contents of the tables 124 00:05:31.840 --> 00:05:33.086 using the circular arrow button. 125 00:05:33.086 --> 00:05:34.299 So you can click on that 126 00:05:34.299 --> 00:05:36.348 and then just sort of review it at any time. 127 00:05:36.348 --> 00:05:38.359 And that's because the view doesn't update automatically. 128 00:05:38.359 --> 00:05:40.581 So what I'll do is I'll just leave these here 129 00:05:40.581 --> 00:05:42.236 and just quickly go through them, 130 00:05:42.236 --> 00:05:44.347 but bearing in mind as we re-run the transactions, 131 00:05:44.347 --> 00:05:47.162 make sure you do actually do the refresh. 132 00:05:47.162 --> 00:05:47.995 All right, so anyway. 133 00:05:47.995 --> 00:05:49.382 Essentially you can see John's balance 134 00:05:49.382 --> 00:05:51.965 is $10.30, or 1,030 in integer, 135 00:05:54.057 --> 00:05:55.483 as an integer value. 136 00:05:55.483 --> 00:05:57.279 And the three transactions are showing correctly 137 00:05:57.279 --> 00:05:59.197 in the history table. 138 00:05:59.197 --> 00:06:01.144 So that bit's working fine. 139 00:06:01.144 --> 00:06:04.784 So the code for the withdrawal method's almost the same. 140 00:06:04.784 --> 00:06:07.403 So we're gonna be writing the time to the database again 141 00:06:07.403 --> 00:06:10.848 using exactly the same code as in the deposit method 142 00:06:10.848 --> 00:06:12.848 to get the current time. 143 00:06:12.848 --> 00:06:14.999 So before we actually go ahead and do that, 144 00:06:14.999 --> 00:06:16.326 I'm gonna add a modified version 145 00:06:16.326 --> 00:06:19.358 of the static current underscore time method 146 00:06:19.358 --> 00:06:20.572 that we used in the last section 147 00:06:20.572 --> 00:06:22.766 to calculate the correct time. 148 00:06:22.766 --> 00:06:25.099 Let me go ahead and do that. 149 00:06:29.347 --> 00:06:32.705 So I'm gonna add it in the account class. 150 00:06:32.705 --> 00:06:35.372 It's going to be: def underscore 151 00:06:36.713 --> 00:06:38.713 current underscore time. 152 00:06:39.581 --> 00:06:43.003 And yes, we need that leading underscore. 153 00:06:43.003 --> 00:06:45.201 And we're gonna return P-Y-T-Z 154 00:06:45.201 --> 00:06:47.868 dot U-T-C dot localise 155 00:06:49.398 --> 00:06:51.481 and datetime dot datetime 156 00:06:53.805 --> 00:06:54.722 dot utcnow. 157 00:07:00.379 --> 00:07:01.720 And I'll just get rid of one of those lines 158 00:07:01.720 --> 00:07:05.260 to keep everything kind of hunky dory. 159 00:07:05.260 --> 00:07:07.534 And we'll also change this. 160 00:07:07.534 --> 00:07:08.915 We can add an annotation there, 161 00:07:08.915 --> 00:07:10.898 'cause it says it can be static: 162 00:07:10.898 --> 00:07:13.648 @staticmethod to keep that happy. 163 00:07:15.967 --> 00:07:18.655 All right, so we'll change now the deposit method 164 00:07:18.655 --> 00:07:21.899 to use that function that we've just created. 165 00:07:21.899 --> 00:07:25.628 So deposit_time is now going to be equal to, 166 00:07:25.628 --> 00:07:27.296 here we're gonna change that to be equal to 167 00:07:27.296 --> 00:07:29.129 account dot underscore 168 00:07:30.487 --> 00:07:32.487 current underscore time. 169 00:07:33.772 --> 00:07:35.573 Okay, so now the withdrawal method. 170 00:07:35.573 --> 00:07:37.602 Let's actually get that working. 171 00:07:37.602 --> 00:07:38.684 So we're gonna do the same here 172 00:07:38.684 --> 00:07:41.225 as we did with the previous method pretty much, 173 00:07:41.225 --> 00:07:42.770 with the deposit method. 174 00:07:42.770 --> 00:07:45.226 So I'm gonna delete that first line. 175 00:07:45.226 --> 00:07:46.871 Delete that. 176 00:07:46.871 --> 00:07:48.561 And, in terms of the code, 177 00:07:48.561 --> 00:07:53.210 we're gonna start with new_balance is equal to 178 00:07:53.210 --> 00:07:56.627 self dot underscore balance minus amount. 179 00:07:58.946 --> 00:08:01.863 Then we're gonna do withdrawal_time 180 00:08:03.716 --> 00:08:07.633 is equal to account dot underscore current_time 181 00:08:09.297 --> 00:08:12.063 to get the current time for our history table. 182 00:08:12.063 --> 00:08:14.445 Then we need our two updates. 183 00:08:14.445 --> 00:08:15.278 We could have copied this, 184 00:08:15.278 --> 00:08:17.158 but I'm just going to type it out again. 185 00:08:17.158 --> 00:08:19.408 UPDATE accounts SET balance 186 00:08:22.108 --> 00:08:25.350 is equal to question mark WHERE, 187 00:08:25.350 --> 00:08:29.026 and name equals question mark in parentheses, 188 00:08:29.026 --> 00:08:33.193 and then the two parameters, new_balance and self.name. 189 00:08:35.684 --> 00:08:38.767 db.execute is going to be INSERT INTO 190 00:08:40.161 --> 00:08:40.994 history 191 00:08:43.022 --> 00:08:44.068 VALUES. 192 00:08:44.068 --> 00:08:46.097 And we're going to insert the three values 193 00:08:46.097 --> 00:08:48.930 like we did in the deposit method. 194 00:08:49.926 --> 00:08:50.759 And this time it's gonna be 195 00:08:50.759 --> 00:08:54.090 withdrawal underscore time, self.name. 196 00:08:54.090 --> 00:08:55.056 And one slight difference here, 197 00:08:55.056 --> 00:08:56.459 we're going to negate the amount, 198 00:08:56.459 --> 00:08:58.959 so it's gonna be minus amount, 199 00:09:00.005 --> 00:09:02.838 db.commit to save the transaction. 200 00:09:04.086 --> 00:09:06.210 And then we're going to update our attribute: 201 00:09:06.210 --> 00:09:07.463 self dot underscore balance 202 00:09:07.463 --> 00:09:10.380 is equal to new underscore balance. 203 00:09:12.520 --> 00:09:14.520 Okay, and fix that typo. 204 00:09:15.708 --> 00:09:17.339 All right, now before I run this code again, 205 00:09:17.339 --> 00:09:20.659 I need to set John's balance in the database back to zero. 206 00:09:20.659 --> 00:09:22.512 So let's go ahead and do that. 207 00:09:22.512 --> 00:09:24.835 So I'm going to just come into here, 208 00:09:24.835 --> 00:09:26.085 make that zero. 209 00:09:27.296 --> 00:09:29.599 And remembering to commit the change as well. 210 00:09:29.599 --> 00:09:30.716 So I've committed that. 211 00:09:30.716 --> 00:09:31.908 And for the history, what we're gonna do 212 00:09:31.908 --> 00:09:35.087 is we're just gonna delete those three transactions. 213 00:09:35.087 --> 00:09:36.556 We're gonna delete those. 214 00:09:36.556 --> 00:09:38.925 And again, I'm gonna make sure those changes are committed. 215 00:09:38.925 --> 00:09:40.868 So now we've got nothing in the history, 216 00:09:40.868 --> 00:09:42.896 there's nothing in the history record if I refresh that. 217 00:09:42.896 --> 00:09:44.028 There's nothing there. 218 00:09:44.028 --> 00:09:46.598 And for accounts, just to make sure we do a refresh, 219 00:09:46.598 --> 00:09:50.599 you can see that we've got a zero balance for John now. 220 00:09:50.599 --> 00:09:52.268 Okay, so in terms of what we've added 221 00:09:52.268 --> 00:09:54.322 to the withdraw method, 222 00:09:54.322 --> 00:09:57.308 you can see that the two methods were almost identical. 223 00:09:57.308 --> 00:09:59.068 And in fact, if we allow negative amounts 224 00:09:59.068 --> 00:10:00.096 for the deposit method, 225 00:10:00.096 --> 00:10:02.173 then really the only difference between them 226 00:10:02.173 --> 00:10:04.427 would be the first condition in each method 227 00:10:04.427 --> 00:10:06.239 and the value returned. 228 00:10:06.239 --> 00:10:08.506 So it probably makes sense to break the common code 229 00:10:08.506 --> 00:10:10.016 out into its own method. 230 00:10:10.016 --> 00:10:12.608 So let's go ahead and do that. 231 00:10:12.608 --> 00:10:15.523 And I'm gonna just come down here after the balance 232 00:10:15.523 --> 00:10:18.382 the show underscore balance method and put it in there. 233 00:10:18.382 --> 00:10:22.215 So def underscore save underscore update self, 234 00:10:24.355 --> 00:10:27.436 and then it's gonna be amount. 235 00:10:27.436 --> 00:10:28.269 Again, we've got an underscore 236 00:10:28.269 --> 00:10:29.965 in front of the save underscore update, 237 00:10:29.965 --> 00:10:32.309 the start of the method name. 238 00:10:32.309 --> 00:10:35.135 And what we're going to do is, 239 00:10:35.135 --> 00:10:36.952 I'm just going to copy and paste five lines 240 00:10:36.952 --> 00:10:38.885 from the deposit method. 241 00:10:38.885 --> 00:10:40.250 And one, two, three, four, five, 242 00:10:40.250 --> 00:10:43.363 basically right up to and including, 243 00:10:43.363 --> 00:10:45.420 well, it's actually six lines, isn't it? 244 00:10:45.420 --> 00:10:47.549 So I'm gonna copy those and paste them directly in here 245 00:10:47.549 --> 00:10:49.871 in the save underscore update, 246 00:10:49.871 --> 00:10:53.324 making sure that we've also got our last balance as well, 247 00:10:53.324 --> 00:10:54.958 self dot underscore balance, 248 00:10:54.958 --> 00:10:55.972 our update in the attribute, 249 00:10:55.972 --> 00:10:57.117 which we are. 250 00:10:57.117 --> 00:10:57.950 So that's fine. 251 00:10:57.950 --> 00:10:59.669 So now that we've actually done that, 252 00:10:59.669 --> 00:11:01.032 the deposit and withdraw methods 253 00:11:01.032 --> 00:11:02.885 can now use this new method 254 00:11:02.885 --> 00:11:04.940 with withdraw passing in a negative amount. 255 00:11:04.940 --> 00:11:07.481 So, we go back up here now to our deposit method. 256 00:11:07.481 --> 00:11:11.503 And what I'm going to do is just comment that out. 257 00:11:11.503 --> 00:11:13.970 Then we just need to make a call 258 00:11:13.970 --> 00:11:15.907 to the new method. 259 00:11:15.907 --> 00:11:19.240 So it's going to be: self dot underscore 260 00:11:20.635 --> 00:11:22.274 save underscore update. 261 00:11:22.274 --> 00:11:24.116 And it's going to be amount. 262 00:11:24.116 --> 00:11:26.702 So we're passing the amount 263 00:11:26.702 --> 00:11:29.872 that was passed ultimately to this method. 264 00:11:29.872 --> 00:11:31.591 And for the withdraw method, 265 00:11:31.591 --> 00:11:34.088 again for now we'll just comment this code out. 266 00:11:34.088 --> 00:11:35.583 And I'm leaving this in, the source, 267 00:11:35.583 --> 00:11:38.626 so that you've got a copy of the original version 268 00:11:38.626 --> 00:11:40.826 just in case you want to play around with it a bit more. 269 00:11:40.826 --> 00:11:41.966 But in this case, we're gonna do: 270 00:11:41.966 --> 00:11:46.186 self dot underscore save underscore update. 271 00:11:46.186 --> 00:11:47.996 But this time it's gonna be minus amount, 272 00:11:47.996 --> 00:11:51.476 'cause we're negating that, 'cause it's a withdrawal. 273 00:11:51.476 --> 00:11:52.426 But everything else should be correct 274 00:11:52.426 --> 00:11:55.386 now that we've actually got that method written. 275 00:11:55.386 --> 00:11:57.836 Now, what might I do just to make this a little bit easier, 276 00:11:57.836 --> 00:11:59.434 is I want to take a copy of that, 277 00:11:59.434 --> 00:12:00.851 paste that there, 278 00:12:02.566 --> 00:12:03.970 and we'll put this above the deposit, 279 00:12:03.970 --> 00:12:05.720 so put it on line 32. 280 00:12:12.261 --> 00:12:13.158 Like so. 281 00:12:13.158 --> 00:12:13.991 Just so we can see it, 282 00:12:13.991 --> 00:12:14.960 because of course that's being called 283 00:12:14.960 --> 00:12:17.183 by these other methods. 284 00:12:17.183 --> 00:12:18.639 All right, and again, just one final point is, 285 00:12:18.639 --> 00:12:21.086 I've marked it as private with the underscore. 286 00:12:21.086 --> 00:12:24.007 This is the same underscore update method 287 00:12:24.007 --> 00:12:27.543 to indicate that it shouldn't be used outside this class. 288 00:12:27.543 --> 00:12:29.504 And so let's go ahead and run this 289 00:12:29.504 --> 00:12:31.843 just to make sure that it works. 290 00:12:31.843 --> 00:12:34.963 And we've actually got an error here. 291 00:12:34.963 --> 00:12:35.800 We just come up here. 292 00:12:35.800 --> 00:12:37.009 It's because I've used self 293 00:12:37.009 --> 00:12:39.892 and I've indicated this is a static method, 294 00:12:39.892 --> 00:12:41.761 but by making sure that it was a static method 295 00:12:41.761 --> 00:12:43.897 of course we haven't got a self anymore. 296 00:12:43.897 --> 00:12:46.202 And if I'd got rid of that, 297 00:12:46.202 --> 00:12:47.401 that would then be valid again. 298 00:12:47.401 --> 00:12:49.579 But in this case, oops, 299 00:12:49.579 --> 00:12:52.397 we actually do want that to be set as a static method, 300 00:12:52.397 --> 00:12:55.496 so consequently the self shouldn't be there. 301 00:12:55.496 --> 00:12:56.478 So okay, we fixed that. 302 00:12:56.478 --> 00:12:58.478 So if we run this again, 303 00:12:59.567 --> 00:13:01.819 we've now got, the updates have gone through, 304 00:13:01.819 --> 00:13:03.042 so you can see there. 305 00:13:03.042 --> 00:13:04.788 But more importantly we want to check the values 306 00:13:04.788 --> 00:13:06.023 of accounts and history, 307 00:13:06.023 --> 00:13:07.637 so note that this again hasn't updated. 308 00:13:07.637 --> 00:13:10.456 We need to refresh, reload. 309 00:13:10.456 --> 00:13:11.289 And now, correctly, 310 00:13:11.289 --> 00:13:13.829 you've got a balance of 1,000 for John now. 311 00:13:13.829 --> 00:13:17.471 And if we do a refresh now on the history table, 312 00:13:17.471 --> 00:13:19.066 we've now got four transactions. 313 00:13:19.066 --> 00:13:21.332 We've got the three that we had previously, 314 00:13:21.332 --> 00:13:25.371 but also the $30 transaction's there as well. 315 00:13:25.371 --> 00:13:27.738 All right, so that seems to be all working fine, 316 00:13:27.738 --> 00:13:28.934 which is great. 317 00:13:28.934 --> 00:13:30.927 So let's move on to the next video. 318 00:13:30.927 --> 00:13:32.230 And in that one, we're going to start looking 319 00:13:32.230 --> 00:13:34.600 at how to retrieve the history data, 320 00:13:34.600 --> 00:13:37.002 specifically the time column. 321 00:13:37.002 --> 00:13:39.375 So see you in the next video.