So this time around, we want to get started on the all sales page, so if I go to admin and choose
all sales, it should list all the sales right here, but only when I'm logged in.
Now, before we do that, my database is just cluttered with partial transactions and things like that.
So what we want to do is to reset our database to a known good version.
And of course, to make that happen, we have to make a couple of changes to our seats, because when
we initially ran our first migration's, it created a widget for sale, but it didn't create any other
product for sale.
And we have a bronze plan.
So let's go fix that up.
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
and I will say SEAD widgets and that's just my name.
You can call it whatever you want.
So that creates two new seats or two new migration's which are in my migration's folder right down here.
And first of all, I'm going to open up my where I create the widgets table and I'm going to get rid
of this line by cutting it, not copying the very last line, the one that inserts one widget.
And then we'll go to my new up migration and paste that in there.
And there's a few things that aren't in this seat that need to be.
So if I look at my database, for example, I have two things in there, the widget.
But when we first inserted that, we didn't have these three fields.
Image is recurring, recurring and plan.
So let's add those will add image is recurring and plan IVI.
And for the very first one, all we need to add here is in between these parentheses, the image, which
is a static widget that is recurring, is zero because this is not a plan and an empty string for the
planet that will duplicate that line and go back here and change this to bronze plan.
And change this to anything I want, but also get three widgets for the price of two every month.
And then we have inventory and I'll leave that at 10 and I'll change this to twenty two thousand, which
is twenty dollars, it doesn't have an image, you may have one.
If so, put it in there.
It is recurring
and I will copy the plan from the database right here.
So it'll copy cancel and I'll put that as the last value.
Now that I've done this, I can go back to my terminal and type.
So to reset.
And that recreates my database, so my password will have gone back to the default value of password
for logging in, but that also cleared out all the orders, all the transactions, everything else.
So I'm starting from a known state, and that's what I need to do.
Now that we've done this, you should probably go and add at least one sale in your database and make
sure it's for a widget, not a plan, because that's what we're working with first.
So in the next lecture, we'll read the database query that allows us to extract all the sales from
the database.
But make sure you do a sale first, otherwise you'll have no results from the query.