Python for Entrepreneurs Transcripts
Chapter: User accounts and identity
Lecture: Demo: Account table creation

Login or purchase this course to watch this video and the rest of the course contents.
0:01 We have an account class but we don't have an account table. Now remember, all we should have to do is run this app,
0:09 it will know what derives from this, it's SqlAlchemyBase and it's going to add the table, remember if the table exists, it won't update it,
0:17 but if it doesn't exist it will create it. But it's not going to work, I want to just remind you why.
0:23 Run this, OK, it looks like it's running, fantastic, if we refresh and- no, let's go back over here to our db session, remember this business,
0:33 where we had to import these things, well, we need to do that again, and for account. Now if I run it, what this is doing is making sure we have that
0:43 before we call create_all on our SqlAlchemyBase, the SqlAlchemyBase has seen the account, so run that again, over here, a little refresh.
0:53 Yay, we have an account class with all the things we'd like. We have our text id, we have our email with the uniqueness,
1:00 with the constraint, and with an index, and some constraints over here as well.


Talk Python's Mastodon Michael Kennedy's Mastodon