feat(models): add email to User and normalize UserProfile
This commit is contained in:
		
							parent
							
								
									f396c98cbe
								
							
						
					
					
						commit
						52bb003980
					
				
					 2 changed files with 15 additions and 15 deletions
				
			
		|  | @ -1,14 +1,13 @@ | |||
| from models import db | ||||
| 
 | ||||
| class UserProfile(db.Model): | ||||
|     __tablename__ = 'user_profile' | ||||
|     __tablename__ = 'user_profiles' | ||||
|      | ||||
|     id = db.Column(db.Integer, primary_key = True) | ||||
|     user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable = False) | ||||
|     first_name = db.Column(db.String(80), nullable = False) | ||||
|     last_name = db.Column(db.String(80), nullable = False) | ||||
|     bio = db.Column(db.Text, nullable = True) | ||||
|     profile_picture = db.Column(db.String(255), nullable = True) | ||||
|     id = db.Column(db.Integer, primary_key=True) | ||||
|     user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False) | ||||
|     first_name = db.Column(db.String(50), nullable=False, default="") | ||||
|     last_name = db.Column(db.String(50), nullable=False, default="") | ||||
|     bio = db.Column(db.Text, default="") | ||||
|     profile_picture = db.Column(db.String(255), default="") | ||||
|      | ||||
|     user = db.relationship('User', back_populates='profile') | ||||
|      | ||||
|     user = db.relationship('User', back_populates='profile') | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Cipher Vance
						Cipher Vance