Created
October 8, 2022 12:55
-
-
Save isaacharrisholt/3defeb38632ac05e59099a84649cda4c to your computer and use it in GitHub Desktop.
The tables for the example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sqlalchemy import ( | |
| Boolean, | |
| Column, | |
| ForeignKey, | |
| Integer, | |
| String, | |
| ) | |
| from sqlalchemy.orm import declarative_base | |
| Base = declarative_base() | |
| class User(Base): | |
| __tablename__ = 'users' | |
| id = Column(Integer, primary_key=True) | |
| name = Column(String(50)) | |
| class Order(Base): | |
| __tablename__ = 'orders' | |
| id = Column(Integer, primary_key=True) | |
| user_id = Column(Integer, ForeignKey('users.id')) | |
| description = Column(String(50)) | |
| payment_status = Column(Boolean, index=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment