So before we deploy our application to our server, we need to make one slight change to our migration's.
If you recall, at no point did we seed our users table.
So if we were to deploy our application to our live server and run the migration's, we would have a
functional application, but no means of logging in.
And fortunately, it's really easy to add that migration.
So I'm going to open a terminal window, make sure I'm in the right direction.
I am, and I will generate a migration.
So to generate and I'll generate this one a sequel, add user to user table or whatever you want to
call it.
And that generates.
So what I'm going to do just to save some time is I'm going to go over to postcode and find my users
table and look for content in there.
And I will select this and I will copy it as an insert statement.
And then I'll go back to my migration, open up the up migration, which is this one, and just paste
that sequel in there because it's sequel.
This should work fine.
Now, one thing I'm going to do is I'll get rid of this column that says ID and I'll let Auto Increment
take care of that for me.
And I should work, so let's run this migration sota migrate now before I run it.
Obviously, I have to delete the existing user in the database, so let me do that first.
I'll just delete this row, save the changes.
So now this table is empty.
So when I run this migration, it should insert that for me.
So when I reload this, it should be in there perfect, so now we have this migration and I'll leave
the down migration empty because really I don't really ever want to down migrate that part.
And when I get to the down migration that drops the user table, that'll delete that record anyway.
So if you want to, you could you could just in your down migration, if you really want to be perfect,
you could just say delete from users where and look at something here.
Email equals and whatever the value is edman at admin dot com and that would be a down migration.
It's entirely up to you.
All right.
So that should take care of the seeds for us.