mirror of
https://github.com/solero/houdini.git
synced 2024-12-23 14:03:38 +00:00
Set track_like date column default value
This commit is contained in:
parent
1c03374bd8
commit
4e8a73591b
@ -971,6 +971,8 @@ CREATE TABLE track_like (
|
||||
|
||||
CREATE INDEX track_like_track_id ON track_like (track_id);
|
||||
|
||||
ALTER TABLE track_like ALTER COLUMN date SET DEFAULT now();
|
||||
|
||||
COMMENT ON TABLE track_like IS 'SoundStudio likes';
|
||||
|
||||
COMMENT ON COLUMN track_like.track_id IS 'Liked track ID';
|
||||
|
@ -1,4 +1,4 @@
|
||||
from houdini.data import db
|
||||
from houdini.data import db, BaseCrumbsCollection
|
||||
|
||||
|
||||
class PenguinTrack(db.Model):
|
||||
@ -19,4 +19,4 @@ class TrackLike(db.Model):
|
||||
nullable=False)
|
||||
track_id = 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)
|
||||
date = db.Column(db.DateTime, primary_key=True, nullable=False, server_default=db.text("now()"))
|
||||
|
Loading…
Reference in New Issue
Block a user