aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql/migrations.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/db/sql/migrations.py')
-rw-r--r--mediagoblin/db/sql/migrations.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/mediagoblin/db/sql/migrations.py b/mediagoblin/db/sql/migrations.py
index 49798a54..3db51ab9 100644
--- a/mediagoblin/db/sql/migrations.py
+++ b/mediagoblin/db/sql/migrations.py
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from sqlalchemy import MetaData, Table, Column, Boolean, SmallInteger
+from sqlalchemy import MetaData, Table, Column, Boolean, SmallInteger, Integer
from mediagoblin.db.sql.util import RegisterMigration
@@ -59,3 +59,15 @@ def add_transcoding_progress(db_conn):
col = Column('transcoding_progress', SmallInteger)
col.create(media_entry)
db_conn.commit()
+
+
+@RegisterMigration(4, MIGRATIONS)
+def add_mediaentry_collections(db_conn):
+ metadata = MetaData(bind=db_conn.bind)
+
+ media_entry = Table('core__media_entries', metadata, autoload=True,
+ autoload_with=db_conn.bind)
+
+ col = Column('collections', Integer)
+ col.create(media_entry)
+ db_conn.commit()