aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db
Commit message (Collapse)AuthorAgeFilesLines
...
* Attachment support in the SQL backendElrond2012-02-282-2/+36
| | | | | | | | | attachments working with the sql backend. - SQL Schema for attachment files, ordering attachments by their name, not by the submission order (as earlier). - Dot-Notation for attachments, where missing. - convert existing attachments over from mongo -> sql
* Let SQL objects support .setdefault() and .delete()Elrond2012-02-261-0/+10
| | | | | | | | | | Some parts in the code like to use .setdefault(). So make them happy and provide a minimal version. It ignores the given default and expects the attribute to already exist. Other parts use .delete() to delete a complete object. This version expects the object to live in a session and also does the final commit.
* Allow .id instead of ._id for the Mongo backendElrond2012-02-251-0/+15
| | | | | | | | | | To allow easier migration to the SQLAlchemy style .id give the User and MediaEntry mongo classes an alias attribute of .id that maps to ['_id']. Use it in the upload process, because this was one of the last positions with a ['_id'] instead of ._id (due to a bug in mongokit).
* Create "gmg convert_mongo_to_sql" commandElrond2012-02-231-3/+3
| | | | | | | | | Finally, to make testing of sql a bit easier, create a bin/gmg command to do the conversion from mongo to sql. It's currently named "convert_mongo_to_sql". The most important option is the gmg -cf option to give a configfile with the appropiate sql_engine definition.
* mongo to sql convert: Better OrderingElrond2012-02-231-4/+4
| | | | | | | | Order the conversion by the "created" attribute. That way the sql ids are mostly in the order they would have been, if sql was used earlier. Makes things nicer to look at in a db dump.
* Updates so that dbupdate command worksChristopher Allan Webber2012-02-181-1/+1
| | | | | | - Various fixes to dbupdate itself - Switching db/sql/migrations.py to use a dict instead of a list - Registering the function
* Merge branch 'master' into sqlmigrateChristopher Allan Webber2012-02-183-9/+36
|\
| * Start having useful defaults for SQLElrond2012-02-181-2/+1
| | | | | | | | | | | | | | | | | | | | Mostly this means: Havintg a config_spec.ini that has a local (relative to mediagoblin.ini) sqlite db with the name "mediagoblin.db". Also: - Add to .gitignore - Add a notice to mediagoblin.ini about the db
| * Fix MediaTag __init__ to handle no argsElrond2012-02-181-3/+5
| | | | | | | | | | Let the init code also handle createing a fresh clean instance without any attrs set.
| * SQL: fail_metadata as JSON encoded fieldElrond2012-02-183-4/+30
| | | | | | | | | | | | | | | | fail_metadata used to be a dict in mongo. So a json encoded field should be okay too. We could use a pickled field instead, which would be more flexible.
* | Merge branch 'master' into sqlmigrateChristopher Allan Webber2012-02-1817-43/+109
|\| | | | | | | | | Conflicts: mediagoblin/db/sql/models.py
| * Drop pre-rendered html: MediaComment.content_htmlElrond2012-02-185-10/+22
| | | | | | | | | | | | | | | | | | | | | | 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 MediaComment.content_html part.
| * Drop pre-rendered html: MediaEntry.description_htmlElrond2012-02-185-12/+23
| | | | | | | | | | | | | | | | | | | | | | 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 MediaEntry.description_html part.
| * Drop pre-rendered html: User.bio_htmlElrond2012-02-185-4/+17
| | | | | | | | | | | | | | | | | | | | | | 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-087-7/+7
| |
| * It's 2012 all up in hereChristopher Allan Webber2012-02-0210-10/+10
| |
| * 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.
* 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.