16 lines
383 B
Python
16 lines
383 B
Python
# models/album.py
|
|
|
|
from sqlalchemy import Column, Integer, String
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
|
|
Base = declarative_base()
|
|
|
|
|
|
class Album(Base):
|
|
__tablename__ = 'albums'
|
|
|
|
id = Column(Integer, primary_key=True)
|
|
title = Column(String(255), nullable=False)
|
|
artist = Column(String(255), nullable=False)
|
|
year = Column(Integer, nullable=False)
|