from flask_sqlalchemy import SQLAlchemy
|
|
|
|
db = SQLAlchemy()
|
|
|
|
class Song(db.Model):
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
title = db.Column(db.String(100), nullable=False)
|
|
author = db.Column(db.String(100), nullable=False)
|
|
year = db.Column(db.Integer, nullable=False)
|
|
album = db.Column(db.String(100), nullable=False)
|
|
lyrics = db.Column(db.Text, nullable=False)
|
|
|
|
def __repr__(self):
|
|
return f'<Song {self.title}>'
|