from mediagoblin.db.sql.models_v0 import Base_v0
from mediagoblin.db.sql.models_v0 import (User, MediaEntry, MediaComment,
Tag, MediaTag, MediaFile, MediaAttachmentFile, MigrationData,
- ImageData, VideoData)
+ ImageData, VideoData, AsciiData, AudioData)
from mediagoblin.db.sql.open import setup_connection_and_db_from_config as \
sql_connect
from mediagoblin.db.mongo.open import setup_connection_and_db_from_config as \
media_types_tables = (
("mediagoblin.media_types.image", (ImageData,)),
("mediagoblin.media_types.video", (VideoData,)),
+ ("mediagoblin.media_types.ascii", (AsciiData,)),
+ ("mediagoblin.media_types.audio", (AudioData,)),
)
height = Column(SmallInteger)
+class AsciiData(Base_v0):
+ __tablename__ = "ascii__mediadata"
+
+ # The primary key *and* reference to the main media_entry
+ media_entry = Column(Integer, ForeignKey('core__media_entries.id'),
+ primary_key=True)
+ get_media_entry = relationship("MediaEntry",
+ backref=backref("ascii__media_data", cascade="all, delete-orphan"))
+
+
+class AudioData(Base_v0):
+ __tablename__ = "audio__mediadata"
+
+ # The primary key *and* reference to the main media_entry
+ media_entry = Column(Integer, ForeignKey('core__media_entries.id'),
+ primary_key=True)
+ get_media_entry = relationship("MediaEntry",
+ backref=backref("audio__media_data", cascade="all, delete-orphan"))
+
+
######################################################
# Special, migrations-tracking table
#