aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/migrations.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into merge-python3-portChristopher Allan Webber2014-09-161-9/+179
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Has some issues, will iteratively fix! Conflicts: mediagoblin/gmg_commands/__init__.py mediagoblin/gmg_commands/deletemedia.py mediagoblin/gmg_commands/users.py mediagoblin/oauth/views.py mediagoblin/plugins/api/views.py mediagoblin/tests/test_api.py mediagoblin/tests/test_edit.py mediagoblin/tests/test_oauth1.py mediagoblin/tests/test_util.py mediagoblin/tools/mail.py mediagoblin/webfinger/views.py setup.py
| * Fix a python2.6 compatibility issue. Removing a dict comprehension.Christopher Allan Webber2014-08-181-1/+2
| | | | | | | | This commit sponsored by Christopher Beppler. Thanks!
| * Elrond keeps pointing out places I should "is not None" at :)Christopher Allan Webber2014-08-081-2/+2
| |
| * Okay, we don't know that indexes are falsey, so let's make it clearer. Yeek!Christopher Allan Webber2014-08-081-1/+1
| |
| * this negation needs parens.Christopher Allan Webber2014-08-081-1/+1
| |
| * Pull the indexes out of the dictionary directlyChristopher Allan Webber2014-08-081-8/+11
| | | | | | | | Instead of checking for their keys and pulling them out later, that is.
| * If the constraint already exists, roll back to a sane state.Christopher Allan Webber2014-08-081-1/+1
| |
| * Explaining why we're committing mid-migrationChristopher Allan Webber2014-08-081-0/+4
| |
| * Only add the constraint if we need to. Catch an exception if we don't.Christopher Allan Webber2014-08-071-6/+10
| | | | | | | | Also, updating the comment about sqlite being crazy :)
| * Document both migrations, comment out old migrationChristopher Allan Webber2014-08-071-9/+35
| |
| * Add a new migration which removes/fixes the old migrationChristopher Allan Webber2014-08-071-0/+50
| | | | | | | | | | | | | | The previous migration, as it turns out, was not needed, and there were many inconsistencies put in place by adding it. See issue #920. This commit sponsored by Gergő Tisza. Thank you!
| * Fix issue where create_uuid doesn't exist nor usedJessica Tallon2014-07-221-1/+2
| |
| * Make sure new media has a new uuid added onJessica Tallon2014-07-221-7/+6
| |
| * Adds migration on MediaEntry to add uuidJessica Tallon2014-07-221-1/+0
| |
| * Fix #894 - index User.username fieldJessica Tallon2014-07-171-1/+15
| | | | | | | | This commit sponsored by Emily O'Leary. Thank you!
| * Adding comments in the migration explaining a bit what's going on.Christopher Allan Webber2014-06-111-0/+2
| | | | | | | | This commit sponsored by Philip Horger. Thank you!
| * Explicitly set the column names to "user" and "privilege"Christopher Allan Webber2014-06-111-2/+4
| |
| * Switch "user_id" to "privilege" and "privilege_id" to "user".Christopher Allan Webber2014-06-101-17/+23
| | | | | | | | | | | | | | | | | | This builds on the previous code Natalie wrote, but makes some changes: - More direct alterations for non-sqlite code - In both cases, I've made it so that we switched the field names from privilege_id and user_id to user and privilege respectively. This way we can do the name swap, but in one case it's "easy": just changing the name. (In the sqlite case it's still tricky though.)
| * Merge remote-tracking branch 'refs/remotes/tilly-q/ticket-874' into mergetestChristopher Allan Webber2014-06-101-0/+46
| |\ | | | | | | | | | | | | Conflicts: mediagoblin/db/migrations.py
| | * Made the columns properly referenced in models and migrations.tilly-Q2014-04-231-10/+7
| | |
| | * Renamed the columns on core__privileges_users table so that they are unique andtilly-Q2014-04-221-0/+45
| | | | | | | | | | | | will not cause any more problems.
| * | Set a default value to MediaEntry.media_metadatatilly-Q2014-05-141-1/+2
| | |
| * | Changed the name of the metadata columntilly-Q2014-04-211-1/+1
| | |
| * | Moved the metadata column to MediaEntry rather than MediaFiletilly-Q2014-04-211-4/+4
| | |
| * | In this commit, I added a new column which will be used for RDFa metadata oftilly-Q2014-04-211-0/+12
| |/ | | | | | | media.
* | Remove sqlalchemy-migrate imports from the codebase. Do not touch tests yet.Berker Peksag2014-06-271-1/+1
| |
* | Use six.text_type instead of unicode().Berker Peksag2014-06-021-2/+4
|/ | | | I will be switch to use ``from __future__ import unicode_literals`` later.
* I went through the code and just removed some blank spaces. I also looked ittilly-Q2013-11-191-3/+2
| | | | thru and it looked great.
* Addressed ticket number 630 by removing MediaEntry.collectedJosie2013-11-181-0/+14
|
* Renaming replace_table to replace_table_hack and documenting why it's a hackChristopher Allan Webber2013-10-101-3/+3
| | | | | | We'd still prefer people use other solutions when possible! This commit sponsored by Michał Masłowski. Thank you!
* Merge remote-tracking branch 'tilly-q/merge-tillyq-moderation' into ↵Christopher Allan Webber2013-10-101-21/+4
|\ | | | | | | merge-tillyq-moderation
| * I made some changes in this commit to help out with other people trying to worktilly-Q2013-10-091-21/+4
| | | | | | | | | | | | around the SQLite problems with Alter table. I added a new function to migration_tools (replace_table) which does all the work I did in my migration of core__users, but is now usable for other migrations.
* | Fix the create_moderation_tables migration to work with postgresqlChristopher Allan Webber2013-10-101-3/+3
|/ | | | Was comparing/assigning to integers... but that's not how postgres rolls!
* Fixing migration to account for new fields added to User modelChristopher Allan Webber2013-10-091-1/+5
| | | | | Uploaded and upload_limit were added after this migration was first written. Tricky!
* Merge remote-tracking branch 'tilly-q/OPW-Moderation-Update' into ↵Christopher Allan Webber2013-10-091-5/+9
|\ | | | | | | merge-tillyq-moderation
| * This was a quick update to clean up some of my templates and fix the formattingtilly-Q2013-10-081-5/+9
| | | | | | | | | | | | | | in some of my other bits of code. In migrations.py, I clarified the comments & fixed the code to stay within 80 columns. In each of the templates, I fixed the spacing as well to stay within 80 columns and I also corrected my improper uses of the trans tag to ensure that these pages can be translated correctly.
* | Adding a comment explaining what vR1 means.Christopher Allan Webber2013-10-081-0/+4
| | | | | | | | This commit sponsored by Kim Jin-hoon. Thank you!
* | Just fixing the order of migrations and a bit of whitespace.Christopher Allan Webber2013-10-081-38/+48
| | | | | | | | This commit sponsored by Glenn McGrath. Thank you!
* | Merge remote-tracking branch 'refs/remotes/tilly-q/OPW-Moderation-Update'Christopher Allan Webber2013-10-071-3/+199
|\| | | | | | | | | | | | | Conflicts: mediagoblin/templates/mediagoblin/user_pages/user.html mediagoblin/tests/test_auth.py mediagoblin/tests/test_submission.py
| * This was a very important update where I fixed a few small but fatal bugs in mytilly-Q2013-10-031-3/+3
| | | | | | | | | | | | | | | | | | code. I had removed the import of Privilege in mediagoblin.db.migrations, and this was still necessary and was causing errors. I also made it so that media deletion by moderators, through reports, actually fully deleted the media, rather than just deleting the database representation of the media. Lastly, I fixed a bug in migration that caused a fatal error on login because the UserBan user_id column was improperly named in it's creation by migration.
| * In this commit, I mostly did work on the migrations. Firstly, I droppped thetilly-Q2013-10-031-42/+129
| | | | | | | | | | | | | | | | | | vestigial columns from the User table (ie. status, email_verified, is_admin). Otherwise, I did a lot of work converting my existing migrations from high- level ORM commands to low-level SQL commands to ensure that the migrating will work regardless of what stage their instance is working in. I also re-integrated my two registered migrations into one. Because the migration became very long, I also added a lot of clarifying documentation.
| * This commit was solely to remove unused imports in the code that I have writtentilly-Q2013-09-231-2/+1
| |
| * At this point, I am very close to done with this code! I made one big change attilly-Q2013-09-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | paroneayea's request, which was to make to possible to turn off user's ability to file reports through a mediagoblin.ini setting. Aside from this, I had to make it possible for the Moderation User Panel to display more than 10 users. And aside from that, I just had to fix some errors which cropped up with my most recent additions. I also fixed some tests that were broken because I had changed the checks for whether or not a user is active. Nearing the end! =============================================================================== Made it possible to turn off reports through a mediagoblin.ini setting =============================================================================== --\ mediagoblin.ini --\ mediagoblin/config_spec.ini --\ mediagoblin/decorators.py --\ mediagoblin/moderation/views.py --\ mediagoblin/templates/mediagoblin/user_pages/media.html --\ mediagoblin/user_pages/views.py =============================================================================== Made User Panel capable of showing more than 1 page of users =============================================================================== --\ mediagoblin/moderation/forms.py --\ mediagoblin/moderation/views.py --\ mediagoblin/templates/mediagoblin/moderation/user_panel.html =============================================================================== Fixed Broken Tests =============================================================================== --\ mediagoblin/tests/test_notifications.py --\ mediagoblin/tests/test_openid.py --\ mediagoblin/tests/test_persona.py --\ mediagoblin/tests/test_reporting.py =============================================================================== Fixed errors in code =============================================================================== --\ mediagoblin/db/migrations.py --| Set nullable to True for MediaReports' and CommentReports' content foreign |keys --\ mediagoblin/db/models.py --| Got rid of cascading rules for MediaReports' and CommentReports' content |foreign keys. This makes it possible for the Reports to continue to exist |after the content is deleted. --\ mediagoblin/moderation/tools.py --| Fixed formatting of Report Resolution Methods --| Took out pieces of code used in debugging --\ mediagoblin/templates/mediagoblin/base.html --\ mediagoblin/templates/mediagoblin/moderation/report.html --| Made reports details page able to tell what is a deleted archived report. --\ mediagoblin/templates/mediagoblin/moderation/report_panel.html --\ mediagoblin/templates/mediagoblin/utils/report.html
| * Merge branch 'master' into OPW-Moderation-Updatetilly-Q2013-09-121-4/+19
| |\ | | | | | | | | | | | | Conflicts: mediagoblin/db/migrations.py
| * | In this commit, I'm deleting the ArchivedReports object, at paroneyea's recom-tilly-Q2013-09-111-12/+3
| | | | | | | | | | | | -mendation. Instead, all of its functionality will be in the ReportBase object.
| * | This should be my final code update before I am ready for review! Basically, intilly-Q2013-09-101-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this update I finished the search/sort function on the Reports Panel. I also finished the Terms of Service and made the decision to remove the meta portion of the site I had planned to create. I decided that the features involved were just unnecessary at this point. I also dropped the User status column and added a migration to establish default privileges (and create the privilege foundat- -ions. I fixed a few small errors that were left over as well, in the implemen- tation and in the tests. Next, I just need to await code review and work on the documentation for these new features. I also need to supervise a new merge to master. =============================================================================== Dropped the vestigial 'status' column =============================================================================== --\ mediagoblin/db/migrations.py --\ mediagoblin/db/models.py --| Also added in comments describing the current situation with the `is_admin` | and `email_verified` columns, where they are 100% vestigial but cannot be | dropped. =============================================================================== Wrote necessary migrations to set up Privilege foundations and give users the necessary privileges on an older implementation of mediagoblin that is migrating into this update =============================================================================== --\ mediagoblin/db/migrations.py =============================================================================== Deleted the meta pages =============================================================================== --\ Deleted mediagoblin/meta/__init__.py --\ Deleted mediagoblin/meta/routing.py --\ Deleted mediagoblin/meta/views.py --\ Deleted mediagoblin/templates/mediagoblin/meta/code_of_conduct.html --\ Deleted mediagoblin/templates/mediagoblin/meta/reports_details.html --\ Deleted mediagoblin/templates/mediagoblin/meta/reports_panel.html ---------------------------------------------------------------- Moved the terms of service to /terms_of_service ---------------------------------------------------------------- --\ Moved mediagoblin/templates/mediagoblin/meta/terms_of_service.html -> mediagoblin/templates/mediagoblin/terms_of_service.html --| I decided that terms of service were really the only necessary part of my | planned "meta" pages, so I moved it instead to its own singular page --\ mediagoblin/routing.py --\ mediagoblin/static/css/base.css --\ mediagoblin/templates/mediagoblin/base.html --\ mediagoblin/views.py =============================================================================== Simplified & Finished the Reports Panel Searching =============================================================================== --\ mediagoblin/moderation/forms.py --\ mediagoblin/moderation/tools.py --\ mediagoblin/moderation/views.py --\ mediagoblin/templates/mediagoblin/moderation/report_panel.html --\ mediagoblin/templates/mediagoblin/moderation/user.html =============================================================================== Fixed Small Errors =============================================================================== --\ mediagoblin/templates/mediagoblin/user_pages/user.html --\ mediagoblin/tests/test_moderation.py --\ mediagoblin/tests/tools.py ===============================================================================
| * | This was a quick update, I mostly worked on the transition from using the oldtilly-Q2013-09-081-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User table columns (is_admin, status, email_verified) and making sure that their functionality is instead completely handled by privileges. I also worked on the meta pages which I hope to finish soon. I set up migrations to ensure the default privileges are given to users that should have them. Lastly, I made it so that banned users can log out. =============================================================================== Made Sure the Vestigial Columns of the User Table were not being Used =============================================================================== --\ mediagoblin/auth/views.py --\ mediagoblin/db/models.py --\ mediagoblin/templates/mediagoblin/base.html --\ mediagoblin/templates/mediagoblin/moderation/user.html --\ mediagoblin/templates/mediagoblin/user_pages/collection_lis$ --\ mediagoblin/templates/mediagoblin/user_pages/user.html --\ mediagoblin/tests/test_auth.py --\ mediagoblin/tests/test_persona.py --\ mediagoblin/user_pages/views.py =============================================================================== Wrote the Migrations to Set up the Default Privileges =============================================================================== --\ mediagoblin/db/migrations.py --\ mediagoblin/gmg_commands/users.py =============================================================================== Work on the Meta Pages =============================================================================== --\ mediagoblin/meta/routing.py --\ mediagoblin/meta/views.py --\ mediagoblin/static/css/base.css --\ mediagoblin/templates/mediagoblin/meta/terms_of_service.html =============================================================================== Small Changes =============================================================================== --\ mediagoblin/templates/mediagoblin/base.html --| Benevolently made it so that banned users can log out =============================================================================== X X X X X X X X X X X X X X X X X X X X ===============================================================================
| * | This is a quick commit. I gave admins the ability to ban or unban userstilly-Q2013-08-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | straight from the moderation.users_detail page. I also changed the UserBan.expiration_date type from DateTime into Date. I also began work on the Terms of Service, pulled from another website (which will be cited clearly before I'm done). I added new tests as well for the ban/unbanning. Lastly, I added a few `user_not_banned` decorators to relevant views, so banned users cannot access any pages.
| * | This was a big commit! I included lots of documentation below, but generally Itilly-Q2013-08-291-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | did a few things. I wrote many many many new tests, either in old test files or in the three new test files I made. I also did some code-keeping work, deleting trailing whitespace and deleting vestigial code. Lastly, I fixed the parts of the code which I realized were broken thru the process of running tests. =============================================================================== Deleted trailing whitespace: =============================================================================== --\ mediagoblin/decorators.py --\ mediagoblin/auth/tools.py --\ mediagoblin/db/migrations.py --\ mediagoblin/db/models.py --\ mediagoblin/gmg_commands/users.py --\ mediagoblin/moderation/forms.py --\ mediagoblin/moderation/tools.py --\ mediagoblin/moderation/views.py --\ mediagoblin/templates/mediagoblin/moderation/media_panel.html --\ mediagoblin/templates/mediagoblin/moderation/report.html --\ mediagoblin/templates/mediagoblin/moderation/report_panel.html --\ mediagoblin/templates/mediagoblin/moderation/user.html --\ mediagoblin/templates/mediagoblin/moderation/user_panel.html --\ mediagoblin/templates/mediagoblin/user_pages/report.html --\ mediagoblin/templates/mediagoblin/utils/report.html --\ mediagoblin/user_pages/lib.py --\ mediagoblin/user_pages/views.py =============================================================================== Deleted Vestigial Code =============================================================================== --\ mediagoblin/db/util.py --\ mediagoblin/tests/test_notifications.py =============================================================================== Modified the Code: =============================================================================== --\ mediagoblin/moderation/tools.py --| Encapsulated the code around giving/taking away privileges into two | funtions. --\ mediagoblin/moderation/views.py --| Imported and used the give/take away privilege functions --| Replaced 'require_admin_or_moderator_login' with |'user_has_privilege(u"admin")' for adding/taking away privileges, only | admins are allowed to do this. --\ mediagoblin/templates/mediagoblin/banned.html --| Added relevant translation tags --| Added ability to display indefinite banning --\ mediagoblin/templates/mediagoblin/user_pages/media.html --| Made sure the add comments button was only visible for users with the | `commenter` privilege --\ mediagoblin/tests/test_submission.py --| Paroneayea fixed a DetachedInstanceError I was having with the our_user | function --\ mediagoblin/tests/tools.py --| Added a fixture_add_comment_report function for testing. --\ mediagoblin/tools/response.py --| Fixed a minor error where a necessary return statement was missing --| Fit the code within 80 columns --\ mediagoblin/user_pages/views.py --| Added a necessary decorator to ensure that only users with the 'commenter' | privilege can post comments =============================================================================== Wrote new tests for an old test file: =============================================================================== --\ mediagoblin/tests/test_auth.py --| Added a new test to make sure privilege granting on registration happens | correctly --\ mediagoblin/tests/test_modelmethods.py* --| Added a test to ensure the User method has_privilege works properly =============================================================================== Wrote entirely new files full of tests: =============================================================================== --\ mediagoblin/tests/test_moderation.py --\ mediagoblin/tests/test_privileges.py --\ mediagoblin/tests/test_reporting.py =============================================================================== =============================================================================== NOTE: Any files I've marked with a * in this commit report, were actually subm- itted in my last commit. I made that committ to fix an error I was having, so they weren't properly documented in that report. =============================================================================== ===============================================================================
| * | This commit was just to fix a few of the errors with the merging and totilly-Q2013-08-201-73/+74
| | | | | | | | | | | | make sure that all of the previous tests work fine.