From f139f7fe24255d46b1a09bffa5439a4784bdd60c Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 18 Mar 2019 15:57:08 +0000 Subject: [PATCH] New sound studio data models --- Houdini/Data/Music.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Houdini/Data/Music.py diff --git a/Houdini/Data/Music.py b/Houdini/Data/Music.py new file mode 100644 index 0000000..1d368d9 --- /dev/null +++ b/Houdini/Data/Music.py @@ -0,0 +1,22 @@ +from Houdini.Data import db + + +class PenguinTrack(db.Model): + __tablename__ = 'penguin_track' + + ID = db.Column(db.Integer, primary_key=True, + server_default=db.text("nextval('\"penguin_track_ID_seq\"'::regclass)")) + Name = db.Column(db.String(12), nullable=False, server_default=db.text("''::character varying")) + OwnerID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False) + Sharing = db.Column(db.Boolean, nullable=False, server_default=db.text("false")) + Pattern = db.Column(db.Text, nullable=False) + + +class TrackLike(db.Model): + __tablename__ = 'track_like' + + PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True, + nullable=False) + TrackID = db.Column(db.ForeignKey('penguin_track.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True, + nullable=False, index=True) + Date = db.Column(db.DateTime, primary_key=True, nullable=False) \ No newline at end of file