WEBVTT 00:00.880 --> 00:06.250 So this time around, we want to get started on the all sales page, so if I go to admin and choose 00:06.250 --> 00:10.900 all sales, it should list all the sales right here, but only when I'm logged in. 00:11.470 --> 00:17.300 Now, before we do that, my database is just cluttered with partial transactions and things like that. 00:17.320 --> 00:22.540 So what we want to do is to reset our database to a known good version. 00:22.540 --> 00:27.490 And of course, to make that happen, we have to make a couple of changes to our seats, because when 00:27.490 --> 00:33.880 we initially ran our first migration's, it created a widget for sale, but it didn't create any other 00:33.880 --> 00:34.810 product for sale. 00:34.810 --> 00:36.010 And we have a bronze plan. 00:36.340 --> 00:37.530 So let's go fix that up. 00:37.660 --> 00:48.310 I'll go over to my ID and I'll open a terminal window and I'll type so to migrate so that generate fees 00:49.000 --> 00:53.870 and I will say SEAD widgets and that's just my name. 00:53.920 --> 00:55.070 You can call it whatever you want. 00:55.780 --> 01:01.060 So that creates two new seats or two new migration's which are in my migration's folder right down here. 01:01.690 --> 01:06.790 And first of all, I'm going to open up my where I create the widgets table and I'm going to get rid 01:06.790 --> 01:12.070 of this line by cutting it, not copying the very last line, the one that inserts one widget. 01:13.780 --> 01:17.950 And then we'll go to my new up migration and paste that in there. 01:18.070 --> 01:21.680 And there's a few things that aren't in this seat that need to be. 01:21.730 --> 01:27.400 So if I look at my database, for example, I have two things in there, the widget. 01:27.400 --> 01:30.790 But when we first inserted that, we didn't have these three fields. 01:30.790 --> 01:33.260 Image is recurring, recurring and plan. 01:33.520 --> 01:41.260 So let's add those will add image is recurring and plan IVI. 01:41.440 --> 01:48.790 And for the very first one, all we need to add here is in between these parentheses, the image, which 01:48.790 --> 01:56.770 is a static widget that is recurring, is zero because this is not a plan and an empty string for the 01:56.770 --> 02:04.270 planet that will duplicate that line and go back here and change this to bronze plan. 02:08.310 --> 02:18.630 And change this to anything I want, but also get three widgets for the price of two every month. 02:20.720 --> 02:25.910 And then we have inventory and I'll leave that at 10 and I'll change this to twenty two thousand, which 02:25.910 --> 02:29.920 is twenty dollars, it doesn't have an image, you may have one. 02:29.930 --> 02:31.000 If so, put it in there. 02:31.790 --> 02:33.020 It is recurring 02:36.110 --> 02:40.220 and I will copy the plan from the database right here. 02:41.620 --> 02:48.620 So it'll copy cancel and I'll put that as the last value. 02:49.910 --> 02:53.720 Now that I've done this, I can go back to my terminal and type. 02:53.810 --> 02:55.610 So to reset. 02:57.620 --> 03:02.660 And that recreates my database, so my password will have gone back to the default value of password 03:02.660 --> 03:07.880 for logging in, but that also cleared out all the orders, all the transactions, everything else. 03:07.910 --> 03:11.120 So I'm starting from a known state, and that's what I need to do. 03:11.660 --> 03:16.910 Now that we've done this, you should probably go and add at least one sale in your database and make 03:16.910 --> 03:20.140 sure it's for a widget, not a plan, because that's what we're working with first. 03:20.900 --> 03:25.430 So in the next lecture, we'll read the database query that allows us to extract all the sales from 03:25.430 --> 03:26.000 the database. 03:26.000 --> 03:29.340 But make sure you do a sale first, otherwise you'll have no results from the query.