aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql
Commit message (Collapse)AuthorAgeFilesLines
...
| * Drop pre-rendered html: User.bio_htmlElrond2012-02-182-2/+1
| | | | | | | | | | | | | | | | | | | | | | After a bit of discussion, we decided to drop the pre-rendered html from the database and render it on the fly. In another step, we will use some proper caching method to cache this stuff. This commit affects the User.bio_html part.
| * sql db design suggestions by Svavar KjarrvalElrond2012-02-111-3/+26
| | | | | | | | | | | | | | | | Many thanks go to Svavar Kjarrval who has taken a deeper look at our current sql db design and made a bunch of suggestions. The suggestions are currently put as TODO items in the docstrings. This way we can keep track of them directly where we need it.
| * Fix copyright statements; add LICENSE for EXIF.pyWill Kahn-Greene2012-02-086-6/+6
| |
| * It's 2012 all up in hereChristopher Allan Webber2012-02-021-1/+1
| |
| * Some small SQL model improvementsElrond2012-01-292-4/+11
| | | | | | | | | | | | | | | | - Add default for User.email_verified - Add default for MediaEntry.state - Let PathTupleWithSlashes store [] as "NULL", but not handling the reverse properly yet! - Add _id alias field to MediaEntry and MediaComment
* | 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.
* Let some code support "media without slug"Elrond2012-01-281-1/+1
| | | | | | | | | | | | | | 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-211-1/+1
|
* Added migration for license field, resolved conflict in db/sql/models.pyAaron Williamson2012-01-196-9/+131
|\
| * 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-181-0/+1
|/ | | | translation tags to license template.
* 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"
* 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.
* Add DB Mixin classes and use themElrond2012-01-081-2/+3
| | | | | | | | | | | | | | | 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.
* sql convert: Use more library functionsElrond2012-01-011-11/+9
| | | | | | | | | | 1. Use the new setup_connection_and_db_from_config in the sql backend. 2. Use sql and mongo specific functions wherever appropiate instead of the generic "db.X" one. This makes the converter more indepedent of the current backend choice.
* Factor out check_db_migrations_currentElrond2012-01-011-0/+4
| | | | | | | | | | When initializing the database connection the current mongo based setup checked for new migrations and warned about them. This was mongo specific so factor'd it out into a more generic check_db_migrations_current function in the mongo backend. Also created a dummy one in the sql backend.
* Add a .save method on the sql db objectsElrond2011-12-291-1/+9
| | | | | | | | This is a shortcut to adding the object to a session (if needed) and giving a commit on the session. In reality, calling code should probably utilize the session on its own and call commit in an appropiate place.