aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db
Commit message (Collapse)AuthorAgeFilesLines
...
* | Excepting that migration 1 doesn't work(!), sqlalchemy migration branch workingChristopher Allan Webber2012-01-291-2/+5
| | | | | | | | | | | | | | The reason migration 1 doesn't work, and is commented out, is because of sqlalchemy-migrate not handling certain constraints while dropping binary sqlite columns right. See also: http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=143&thanks=143&ts=1327882242
* | Update the string outputs to match our tests: newlines, ...->:, etc.Christopher Allan Webber2012-01-291-2/+2
| |
* | migrations_to_run here a list, so no reason to call itChristopher Allan Webber2012-01-291-1/+1
| |
* | self.latest_migration now a property, so we shouldn't __call__ it!Christopher Allan Webber2012-01-291-1/+1
| |
* | For clarity, self.database -> self.session.Christopher Allan Webber2012-01-291-12/+12
| | | | | | | | | | Actually, I'm not even sure *that* is ideal! But better than what we had...
* | Yet *another* self.database -> self.database.bind fix!Christopher Allan Webber2012-01-291-1/+1
| |
* | Fix database_current_version for when self.migration_data is None.Christopher Allan Webber2012-01-291-0/+4
| |
* | another db -> db.bind fix.Christopher Allan Webber2012-01-291-1/+1
| |
* | A few basic fixes to sql/util.pyChristopher Allan Webber2012-01-291-5/+9
| | | | | | | | | | | | - MigrationRecord to MigrationData, again - If the table doesn't exist, return None for database_current_migration - database.engine -> database.bind
* | Also switch database_current_migration to a propertyChristopher Allan Webber2012-01-291-3/+4
| |
* | Make latest_migration a propertyChristopher Allan Webber2012-01-291-0/+1
| |
* | Import MigrationData, not MigrationRecordChristopher Allan Webber2012-01-291-3/+3
| |
* | import changeset into sql modelsChristopher Allan Webber2012-01-291-0/+7
| |
* | Another db->db.engine because I'm bad at things ;)Christopher Allan Webber2012-01-291-7/+7
| | | | | | | | Thanks again Elrond.
* | Another MigrationManager fix.Christopher Allan Webber2012-01-291-1/+1
| | | | | | | | self.database -> self.database.engine (thanks again Elrond for the catch)
* | Make name the primary key in migration recordsChristopher Allan Webber2012-01-291-2/+1
| |
* | assert was positive when it should be negative, fixedChristopher Allan Webber2012-01-291-1/+1
| |
* | Use .first() instead of [0]... thanks elrond :)Christopher Allan Webber2012-01-291-5/+2
| |
* | We should probably add that object to the DB also :PChristopher Allan Webber2012-01-291-1/+2
| |
* | Commit that new migration record ;)Christopher Allan Webber2012-01-291-0/+1
| |
* | Add create_new_migration_record method to MigrationManagerChristopher Allan Webber2012-01-291-2/+7
| |
* | Added init_tables method to MigrationManagerChristopher Allan Webber2012-01-291-2/+12
| |
* | More work on SQL MigrationManagerChristopher Allan Webber2012-01-291-15/+25
| | | | | | | | | | | | | | Added methods: - migration_data - database_current_migration - migrations_to_run
* | Removing printer argument now that we use self.printerChristopher Allan Webber2012-01-291-1/+1
| |
* | Finishing the init_or_migrate functionChristopher Allan Webber2012-01-291-1/+7
| |
* | More work on migration manager, including adding a dry run functionChristopher Allan Webber2012-01-291-6/+76
| |
* | Beginnings of the SQL migration managerChristopher Allan Webber2012-01-291-1/+100
| |
* | Big ol' start of the SQL migrations system.Christopher Allan Webber2012-01-293-0/+97
|/ | | | Things definitely don't work yet, but should be heading in the right direction.
* Nearly complete support for TagsElrond2012-01-282-4/+52
| | | | | | | | | | | These changes allow all of the rest of the code to use tags in sql as they were used on mongo. It's not efficient at all, as changing tags usually means to remove all old tags and adding all new. The only problem here is: Old slugs for tags are not removed, because they're shared across all MediaTags and dropping orphans is not always easy.
* Add develover sql switchElrond2012-01-282-4/+20
| | | | | | | | | | | | | | | | | If you want to play with the current state of sql, you need a switch to turn it on. So here is the super secret developer switch. So you want to know where it is? Here it is: Create a file mediagoblin/db/sql_switch.py and put one line in it: "use_sql = True" (or False to disable again). Right, that's it. If you want to delete it, remember to delete the *.pyc too. Be careful not to "git add" it by accident!
* Let some code support "media without slug"Elrond2012-01-282-13/+10
| | | | | | | | | | | | | | The upcoming SQL database will allow having media without a slug again. This might especially be useful for API support, where the uploaded image (media) does not have *any* information to generate a slug from. This code change mostly allows the sql backend to have no slug in its model and improves some parts to properly handle that. It specifically does not have any web frontend support to edit/create MediaEntries with no slug.
* Move declarative_base Base into base.pyElrond2012-01-262-5/+5
| | | | The base class of all models "Base" should be in base.py.
* Proper url_to_{prev,next} for SQLElrond2012-01-221-0/+21
| | | | Uses complete sqlalchemy syntax now.
* Create a fully functional get_comments for SQLElrond2012-01-221-0/+7
| | | | | Using proper sqlalchemy syntax instead of the emulated mongo one.
* Convert over the license field, too!Christopher Allan Webber2012-01-211-1/+1
|
* License "all rights reserved" default should be None/NULL, not empty stringChristopher Allan Webber2012-01-213-3/+3
|
* Added migration for license field, resolved conflict in db/sql/models.pyAaron Williamson2012-01-197-9/+138
|\
| * Add copyright header and a bit of pep8ificationElrond2012-01-206-11/+113
| | | | | | | | | | | | Nearly all the sql files missed a copyright header. So added it! And while there fixed a few pep8 things.
| * Use custom query classElrond2012-01-201-1/+21
| | | | | | | | | | | | | | | | | | A custom query class allows to add more methods on queries (read: "cursors"). This custom query class especially adds a .sort with a calling convention exactly like the mongo one. Makes a lot of existing code happy!
* | Moved get_license_data to mixin.py, added license to sql media model, added ↵Aaron Williamson2012-01-183-6/+7
| | | | | | | | translation tags to license template.
* | Merge branch 'mediagoblin-upstream' into feature544_basic_license_dataAaron Williamson2012-01-181-0/+28
|\|
| * sql/fake.py: Some fake objects/methods to calm the codeElrond2012-01-181-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | sql/fake.py contains some fake classes and functions to calm the rest of the code base. Or provide super minimal implementations. Currently: - ObjectId "class": It's a function mostly doing int(first_arg) to convert string primary keys into integer primary keys. - InvalidId exception - DESCENING "constant"
* | Fixed a syntax error in edit/views and added back in some missing license ↵Aaron Williamson2012-01-171-1/+8
| | | | | | | | stuff from models
* | Fixed merge with upstreamAaron Williamson2012-01-171-106/+47
| |
* | Merged changes with upstreamAaron Williamson2012-01-1716-318/+902
|\|
| * Add MediaFile table and related infrastructure.Elrond2012-01-113-3/+49
| | | | | | | | | | | | | | | | | | | | | | | | - This adds a new SQL table field type for path tuples. They're stored as '/' separated unicode strings. - Uses it to implement a MediaFile table. - Add relationship and proxy fields on MediaEntry to give a nice media_files "view" there. - Let the converter fill the MediaFile.
| * Fix url_for_self mixupElrond2012-01-112-24/+5
| | | | | | | | | | Move changes from mongo/models:url_for_self back into mixin:url_for_self.
| * Merge branch 'master' of gitorious.org:mediagoblin/mediagoblinChristopher Allan Webber2012-01-103-42/+97
| |\ | | | | | | | | | | | | Conflicts: mediagoblin/db/mongo/models.py
| | * Add DB Mixin classes and use themElrond2012-01-083-61/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A bunch of functions on the db objects are really more like "utility functions": They could live outside the classes and be called "by hand" passing the appropiate reference. They usually only use the public API of the object and rarely use database related stuff. Goals: - First, simple: Share the code with the SQL objects, so that the code doesn't need to be duplicated. - Second, it might unclutter the db models and make them more into "model only" stuff. - Doesn't really hurt.
| * | Fixed #724 and added extra infos to the atom feed (author uri and links to ↵Michele Azzolari2012-01-101-3/+5
| |/ | | | | | | the html version of each entry)