aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db
Commit message (Collapse)AuthorAgeFilesLines
* Fix some unused imports and local variables.Ben Sturmfels2021-09-234-15/+9
|
* Apply pyupgrade --py36-plus.Ben Sturmfels2021-09-233-12/+12
| | | | This removes some 'u' prefixes and converts simple format() calls to f-strings.
* Remove remaining imports/calls to six not automatically removed by pyupgrade.Ben Sturmfels2021-03-054-8/+3
|
* Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.Ben Sturmfels2021-03-059-111/+103
|
* Fix saving original of the videoBoris Bobrov2018-07-131-2/+2
| | | | | | | | | Original of the video was not saved because info about it was not written to the database. Fixed that. Also removed original video from get_all_media listing. The method is weird, we should evaluate whether it is video-specific and how to generalize it.
* nitpickingBoris Bobrov2018-07-131-1/+1
|
* Merge branch 'transcoding_progress'Boris Bobrov2018-07-123-2/+58
|\ | | | | | | This probably broke stuff
| * Add main_transcoding_progress column migrationvijeth-aradhya2017-08-222-0/+29
| | | | | | | | | | | | | | This field is required to store the progress of the default resolution of the media. So, we now store the total progress of transcoding the video in 'transcoding_progress' and progress of transcoding the default resolution in 'main_transcoding_progress'.
| * Change webm to webm_video in media_size checkvijeth-aradhya2017-08-141-2/+2
| | | | | | | | Closes #8
| * Merge branch 'master' into 'multiple-qualities-frontend'Vijeth Aradhya2017-08-141-342/+0
| |\ | | | | | | | | | | | | Add multiple video qualities feature See merge request !2
| * | Fix percentage reportingvijeth-aradhya2017-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | | Report transcoding_progress as the overall percent of all resolutions. Modify Logging. Closes #6
| * | Add get_all_media() in MediaEntryMixinvijeth-aradhya2017-07-161-0/+27
| | | | | | | | | | | | | | | Returns all available qualties of a media with it's dimensions and resolution label.
* | | Merge remote-tracking branch 'gsoc2016/Subtitle-1'Boris Bobrov2018-07-102-1/+62
|\ \ \
| * | | Adding the migration filesaksham11152016-07-191-0/+36
| | | |
| * | | Subtitle built over attachments : workingsaksham11152016-07-191-1/+26
| | | |
* | | | move alembic.ini to python app dirBoris Bobrov2017-11-142-3/+58
| | | |
* | | | Added tags in API (view them and edit them)Romain Porte2017-11-121-1/+10
| |_|/ |/| |
* | | Remove mongodb-related stuffBoris Bobrov2017-06-181-342/+0
| |/ |/| | | | | We dropped mongodb a long time ago
* | Pass connection to EnvironmentContext.configureBoris Bobrov2017-03-041-2/+1
| | | | | | | | | | | | In https://bitbucket.org/zzzeek/alembic/issues/419/ we were suggested use connection instead of engine. This should fix an issue reported via ml.
* | Revert "fixed bug #728"Boris Bobrov2016-08-161-3/+3
| | | | | | | | | | | | This reverts commit dbb86ffbbf25651330266435752a6a0422cfb6e5. It caused bug 5469
* | Do not try to get private attributes for commentsBoris Bobrov2016-08-081-1/+8
| | | | | | | | Most probably, they are sqlalchemy's!
* | Adding compatibility stuff for themesBoris Bobrov2016-07-311-11/+32
| | | | | | | | | | | | | | During our migration to federation some interfaces were changed. We should not have done that so fast. Provide a compatibility layer so that old themes work
* | fixed bug #728Boris Bobrov2016-07-251-3/+3
|/
* migrations: Only don't import "migrate" if it's not availableChristopher Allan Webber2016-03-291-1/+9
| | | | | * mediagoblin/db/migrations.py: Import migrate if available; if not print a warning.
* Only run sqlalchemy-migrate migrations if we have to; separate foundationsChristopher Allan Webber2016-03-261-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal is to get things to the point where Alembic can run on its own for new databases and initialize the whole database on its own. There are risks to not doing so, see #5413 for details. There's a lot more here that could removed or cleaned up once sqlalchemy-migrate is *completely* removed in the future. * mediagoblin/db/migration_tools.py (MigrationManager.foundations): Removed attribute. (MigrationManager.populate_table_foundations): Removed method. (MigrationManager.init_or_migrate): Removed call to deprecated method. (populate_table_foundations): New function, refactored from former MigrationManager method of same name. * mediagoblin/gmg_commands/dbupdate.py: Import populate_table_foundations. (DatabaseData.foundations): Remove attribute. (DatabaseData.make_migration_manager): Adjust instantiation of MigrationManager. (gather_database_data): Move out the work of building up foundations data. (run_foundations): New method, incorporating logic for gathering and running foundations which was previously spread across other functions and methods. (run_alembic_migrations): Remove deprecated comment. (run_dbupdate): Only run sqlalchemy migrations if we have to. Also run run_foundations if we are setting up this database for the first time. (sqam_migrations_to_run): New method.
* Switch initial_revision alembic migration to make tables if they aren't thereChristopher Allan Webber2016-03-261-1/+401
| | | | | | | | | This is a necessary step towards deprecating sqlalchemy-migrate. * mediagoblin/db/migrations/versions/52bf0ccbedc1_initial_revision.py (upgrade): Update for adding tables. Mostly generated via Alembic's autogenerate tools. (downgrade): Added a comment.
* Set target_metadata in alembic's env.py to Base.metadataChristopher Allan Webber2016-03-261-1/+2
| | | | | | | | This allows us to make use of automatically generated migrations, at least for core. * mediagoblin/db/migrations/env.py (target_metadata): Switch to gmg's Base.metadata.
* Update out script.py mako template to support branch_labelsChristopher Allan Webber2016-03-261-1/+3
| | | | | | | This is important (probably) for long-running plugin branches. * mediagoblin/db/migrations/script.py.mako: Updated to upstream Alembic version of this file.
* dbupdate updates to use plugin migrations if availableChristopher Allan Webber2016-03-261-46/+0
| | | | | | | | | This makes use of the recently added "build_alembic_config" tool and removes AlembicMigrationManager. * mediagoblin/db/migration_tools.py (AlembicMigrationManager): Removed. * mediagoblin/gmg_commands/dbupdate.py (run_alembic_migrations): Adjusted to use recently added build_alembic_config tool.
* Add build_alembic_config, use it to add plugin migrations to alembic configChristopher Allan Webber2016-03-261-0/+34
|
* typo fix: Set sqlalchemy.url, not qlalchemy.urlChristopher Allan Webber2016-03-021-1/+1
|
* Remove old hack to support pre-0.7.5 Alembic versionsChristopher Allan Webber2016-03-021-3/+0
| | | | | Thanks to Jessica Tallon for pointing out this TODO and its associated hack could be removed.
* Fix #5376 - Ensure links have correct IDJessica Tallon2016-03-012-14/+9
| | | | | | | This ensures that links to comments have the correct ID (the ID of the Comment object) as well as fixing deletion on reports and fixing a few other little things. I hope this fixes the #5376 issue, though cannot reproduce so unable to confirm.
* Fix #5431 - Typo in modelsAndrew Browning2016-03-011-1/+1
| | | | Fix a typo in models.py.
* Fixes #5421 - Ensures Report.object_id is nullableJessica Tallon2016-02-291-0/+33
| | | | | | | It seems there was a commit for a while where the migration was making Report.object_id NOT NULL and this caused an errror when a report deleted the associated object (media). This migrtion checks it's nullable and if not, alters it so it is.
* Migration for #5415 - I forgot it, Doh!Jessica Tallon2016-02-291-0/+44
|
* Fix a typo in consolidate_reports migrationJessica Tallon2016-02-291-1/+1
|
* Fix #5415 - Deleted comments get removed properly when tombstonesJessica Tallon2016-02-291-0/+11
| | | | | | The original wrapper existed and should be been removed, this fix now ensures the TextComment removes the Comment wrapper to prevent the deleted (comments which are tombstones) existing.
* Simply for the Notification.object_id migrationJessica Tallon2016-02-291-10/+0
|
* Missing perensJessica Tallon2016-02-291-1/+3
|
* Fixed issue introduced in previous migrationJessica Tallon2016-02-291-0/+39
|
* Change Notification.object_id to be ID of Comemnt not TextCommentJessica Tallon2016-02-291-0/+72
| | | | | | | | This shouldn't really effect much but it is a needed change for the future this changes the Notification.object_id to be the ID of the Comment (the link table to the comment object) rather than TextComment (the comment object itself). This is needed as now comments can be other things, other than TextComment.
* do not show error message when it's not a exceptionBoris Bobrov2016-02-231-1/+1
| | | | | | | | Gah, the previous patch was not enough! We cannot use text, we can only use exception with a special attribute. Lets return safe None for now an resolve this properly later, when we're not in the freeze.
* Catch import error when text is used as a reason instead of pathBoris Bobrov2016-02-231-1/+11
| | | | | | | | fail_error was used in import, but due to some changes text could appear there and it caused an error. There is little sense now to remove these text messages because they are probably in databases already, so just ignore import errors.
* Fix issue #5411 sqlite connection closesAndrew Browning2016-02-232-2/+4
| | | | | This update changes migrations to wrap db.execute results in a list to keep the connection from closing for sqlite migrations.
* Display type icon in thumbnailsBoris Bobrov2016-02-051-4/+13
|
* Fix #5398 and #5395 - Fix tests failing due to problem creating connection ↵Jessica Tallon2016-01-202-13/+12
| | | | | | | | | | | | | | | for alembic For some reason the alembic connection wasn't seeing any tables that existed however the existing connection works well and we shouldn't be creating a brand new one when we have one ready to use. I've used a little bit of a hack due to our old version of alembic. After 0.7.5 of alembic it offers a `Config.attributes` dictionary which is designed to allow you to pass your connection/engine/whatever to the env.py config script so you're not required to create new ones. As we're on an older version I just create a dictionary with the same name and use it as otherwise documented. It seems this is the suggested fix for #5395 and it fixes #5398 too.
* Fix #5390 - Create migration to delete Notifications and fix ReportJessica Tallon2016-01-203-4/+81
| | | | | | | When a user deleted media or other objects any notificationn objects or reports would cause errors as the object doesn't exist anymore. This now removes them or sets them to None as expected by the code. This also adds some code to the base deletion code to make sure this happens when an object is deleted.
* Use inspect_table inplace of redefining them allJessica Tallon2016-01-181-38/+12
| | | | | | Just like we would have in sqlalchemy-migration inspect_table works and is better than constantly redefining a table in the migration. This switches the migration to use that method.
* Fix #5391 - Alembic migrations would only work for SQLiteJessica Tallon2016-01-181-0/+1
| | | | | | The database connection was being set in a alembic.ini config file, if the user had specified postgres the "sqlite" connection URL in alembic.ini would override that. We probably should look into this more so i've opened #5395.