aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql
Commit message (Collapse)AuthorAgeFilesLines
* Move db.sql.migration_tools to db.migration_tools.Elrond2013-01-081-270/+0
| | | | Follow the new trend.
* Add inspect_table.Elrond2013-01-081-0/+7
| | | | | | In our current scheme of migrations, we reflect the current sql schema into an SQLAlchemy schema. So let's have a tool function for this.
* Move all the migration tools into new migration_tools.pyElrond2013-01-081-0/+263
| | | | | | | | | Factor all the migration related stuff out into a new .db.sql.migration_tools. First we don't have to load this module for our normal server. Second it makes all the import dependencies a little more cleaner.
* Mv db.sql.base to db.baseSebastian Spaeth2013-01-072-106/+0
| | | | | | | | This concludes the db.sql.* -> db.* move. Our db abstraction layer is sqlalchemy, so there is no need to a separate db.sql.* hierarchy. All tests have been run for each of the commit series to make sure everything works at every step.
* Move mediagoblin.db.sql.extratypes to mediagoblin.db.extratypesSebastian Spaeth2013-01-071-63/+0
| | | | No other functional changes.
* Move db.sql.models* to db.models*Sebastian Spaeth2013-01-072-767/+0
|
* Move db.sql.util to db.utilSebastian Spaeth2013-01-071-327/+0
| | | | | | | | Now that sqlalchemy is providing the database abstractions, there is no need to hide everything in db.sql. sub-modules. It complicates the code and provides a futher layer of indirection. Move the db.sql.util.py to db.util.py and adapt the importers.
* Remove mediagoblin.db.sql.fake.DESCENDINGSebastian Spaeth2013-01-072-34/+1
| | | | | | | | This is the last remnant that requires us to keep db.sql.fake.py. Use ModelName.desc() or sqlalchemy.sql.expression.desc(column) to achieve descending sorts. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Remove ObjectId from the treeSebastian Spaeth2012-12-251-9/+0
| | | | | | | This was one of the last remaining Mongo holdouts and has been removed from the tree herewith. Good bye, ObjectId. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Remove InvalidIdSebastian Spaeth2012-12-251-9/+1
| | | | | | It was a NoOp in our Non-mongo world. So it is safe to remove. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Move db.sql.migrations to db.migrationsSebastian Spaeth2012-12-251-189/+0
|
* Move db.sql.open to db.openSebastian Spaeth2012-12-252-79/+1
| | | | | | Now that mongo has been ripped out and sqlalchemy is already providing the database abstraction, there is no need to hide everything in the sql module. Transition db.sql.open to db.open and adapt all direct importers.
* RIP out mongoSebastian Spaeth2012-12-253-284/+2
| | | | | | | | | Since sqlalchemy is providing our database abstraction and we have moved away from Mongo as the underlying database, it is now time to simplify things and rip out mongo. This provides the bulk of the changes, and can stand on its own. There are some followup tasks that can be done, such as removing now unneeded abstraction layers, e.g. db.sql.fake.py
* Mongo removal: Remove the validate=True arg to obj.save()Elrond2012-12-241-2/+1
| | | | | all callers were forced to use validate=True anyway. So remove this useless stuff.
* Remove Mongoism query.skip()Sebastian Spaeth2012-12-211-3/+0
| | | | | | | | | | sqlalchemy supports slice() or [n:m] just fine. Right now, it seems we cannot distinguish beween "empty" results and out-of bound slices. It would be nice if we could distinguish these somehow. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Remove SimpleFieldAliasSebastian Spaeth2012-12-211-12/+0
| | | | | | | It was only used for the model._id -> model.id conversion and is not needed anymore. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Move DBModel._id -> DBModel.idSebastian Spaeth2012-12-212-25/+2
| | | | | | | | | | | | | | | | | | | | | | | We were refering to model._id in most of the code base as this is what Mongo uses. However, each use of _id required a) fixup of queries: e.g. what we did in our find() and find_one() functions moving all '_id' to 'id'. It also required using AliasFields to make the ._id attribute available. This all means lots of superfluous fixing and transitioning in a SQL world. It will also not work in the long run. Much newer code already refers to the objects by model.id (e.g. in the oauth plugin), which will break with Mongo. So let's be honest, rip out the _id mongoism and live with .id as the one canonical way to address objects. This commit modifies all users and providers of model._id to use model.id instead. This patch works with or without Mongo removed first, but will break Mongo usage (even more than before) I have not bothered to fixup db.mongo.* and db.sql.convert (which converts from Mongo to SQL) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Remove print statments from this migration.Christopher Allan Webber2012-12-101-6/+5
| | | | | | | The reason for wanting to give extra information to the user (this is a very special case migration) is good, but we don't have a nice "official" way to capture and present that information during tests, so removing this.
* Fix typo, disable debugging.Elrond2012-12-101-3/+2
|
* UniqueConstraing migration: Adding the explaining comments.Elrond2012-12-101-0/+23
| | | | Add a lengthy comment explaining all the variants.
* Fixing our broken CollectionItem unique constraint.Elrond2012-12-101-4/+42
| | | | | This one seems to work nicely in all relevant situations. See comments inside the source.
* Ensure query_dict is a dict after the contents have been modified.Nathan Yergler2012-12-101-2/+8
| | | | | | _fix_query_dict modifies its argument in place. Ensure that the argument passed in has a local name and will be passed into the subsequent filter_by call.
* Eeek! Set the migration number to the current migration number being run!Christopher Allan Webber2012-12-091-1/+1
|
* Elrond's suggestion: have set_current_migration execute after each migration ↵Christopher Allan Webber2012-12-091-1/+1
| | | | run.
* Merge some small bits by spaetz. Needed later.Elrond2012-11-282-6/+8
|\ | | | | | | | | | | * commit '9437ea4742': Add commit argument to clean_orphan_tags Add "commit" argument to Base model delete()
| * Add commit argument to clean_orphan_tagsSebastian Spaeth2012-11-281-4/+4
| | | | | | | | So we can prevent the session from being committed if we don't want it.
| * Add "commit" argument to Base model delete()Elrond2012-11-281-2/+4
| | | | | | | | | | | | | | | | | | In case we want to bundle db actions into a single transaction, we can now use delete(commit=False) to prevent the transaction from being committed immediately. This is useful when e.g. deleting a User() and thousands of his MediaEntries in a single commit. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Merge remote-tracking branch 'refs/remotes/elrond/sql/migrate_new_tables'Christopher Allan Webber2012-11-261-33/+45
|\ \ | |/ |/|
| * SQL Migrations: Rewrite table creation completely.Elrond2012-11-241-33/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | We have migrations creating new tables. Those currently use "raw" table definitions. This easily gives errors (we already had this problem). So instead rewrite those to use declarative tables and use those to create new tables. Just copy the new table over to the migration, strip it down to the bare minimum, rename to _v0, base it on declarative_base() and be done! Do this for the current migrations.
* | Stop unicode conversion warning during dbupdate.Elrond2012-11-241-1/+1
|/ | | | Just force the passed in name to MigrationManager() to unicode.
* Added cascade all, delete-orphan to ProcessingMetaDataJoar Wandborg2012-09-271-5/+7
|
* HTTP callback fixesJoar Wandborg2012-09-261-1/+9
| | | | | | | | | | | - Added HTTPError catching around the callback request, to not mark the entry as failed, just log the exception. - Fixed bug where I forgot to actually fetch the entry before passing it to json_processing_callback. - Changed __main__ migration #6 to create the ProcessingMetaData table as it is currently, to prevent possible breakage if a siteadmin is lagging behind with his db migrations and more than one migration wants to fix stuff with the ProcessingMetaData table.
* Added support for http callbacks on processingJoar Wandborg2012-09-262-2/+24
| | | | | Sends an HTTP POST request back to an URL given on submission to the API submit view.
* Added client registration caps to OAuth pluginJoar Wandborg2012-09-212-7/+13
| | | | | | | | | | | | | | | | | | | THE MIGRATIONS SUPPLIED WITH THIS COMMIT WILL DROP AND RE-CREATE YOUR oauth__tokens AND oauth__codes TABLES. ALL YOUR OAUTH CODES AND TOKENS WILL BE LOST. - Fixed pylint issues in db/sql/migrations. - Added __repr__ to the User model. - Added _disable_cors option to json_response. - Added crude error handling to the api.tools.api_auth decorator - Updated the OAuth README. - Added client registration, client overview, connection overview, client authorization views and templates. - Added error handling to the OAuthAuth Auth object. - Added AuthorizationForm, ClientRegistrationForm in oauth/forms. - Added migrations for OAuth, added client registration migration. - Added OAuthClient, OAuthUserClient models. - Added oauth/tools with require_client_auth decorator method.
* Added default for 'collected' column to migrationAaron Williamson2012-09-181-1/+1
|
* Fixed migrations for Collection and CollectionItem tablesAaron Williamson2012-09-181-2/+5
|
* Added migrations for Collection and CollectionItem tablesAaron Williamson2012-09-181-1/+30
|
* Fixed collections migration to add 'collected' column to media_entries ↵Aaron Williamson2012-09-181-2/+2
| | | | instead of 'collections'
* Added basic collection functionalityAaron Williamson2012-09-183-4/+81
|
* Fixed testsJoar Wandborg2012-09-151-1/+1
| | | | | - Adapt tests to new global_config arg for run_dbupdate - Account for [plugins] not being set in config
* Add OAuth models, plugin DB migrations, api_authJoar Wandborg2012-09-131-4/+13
|
* Fixed a UnicodeError in the sql.models.MediaEntryJoar Wandborg2012-08-031-1/+3
| | | | | The __repr__() call would crash the process when it tried to convert an unicode title to ASCII for terminal/logfile output.
* Moving the "dependency injection printer tools" over to tools/common.pyChristopher Allan Webber2012-07-141-8/+2
|
* Panel improvementsJoar Wandborg2012-07-112-1/+21
| | | | | | | | | | - Added progress meter for video and audio media types. - Changed the __repr__ method of a MediaEntry to display a bit more useful explanation. - Added a new MediaEntry.state, 'processing', which means that the task is running the processor on the item currently. - Fixed some PEP8 issues in user_pages/views.py - Fixed the ATOM TAG URI to show the correct year.
* Prevent non-Unicode SQLAlchemy warnings in most submission tests.Brett Smith2012-07-081-2/+2
| | | | This commit makes test_submission mostly warning-clean.
* First migration fix: commit after each migration.Elrond2012-06-141-0/+2
| | | | | | | | | | | | sqlite doesn't like complex changes (alter table) to happen inside a transaction that has already done other things. And really, each migration should say "I'm done" and commit its changes. This is not the full story, but it's the core of it. Specifially the migration framework should probably do a rollback "just in case" after each migration.
* FIXED SQL MIGRATION #2Joar Wandborg2012-06-102-3/+5
|
* Added SQL migrations for email notificationsJoar Wandborg2012-06-101-2/+14
|
* Merge remote-tracking branch ↵Joar Wandborg2012-06-101-0/+1
|\ | | | | | | | | | | | | 'is_derek/bug405_email_notifications_for_comments' into notifications-merge Conflicts: mediagoblin/db/mongo/migrations.py
| * Merge branch 'master' into derek-moore-bug405_email_notifications_for_commentsChristopher Allan Webber2012-03-183-16/+107
| |\ | | | | | | | | | | | | Conflicts: mediagoblin/db/mongo/migrations.py