| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Follow the new trend.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
No other functional changes.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
It was a NoOp in our Non-mongo world. So it is safe to remove.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
all callers were forced to use validate=True anyway. So
remove this useless stuff.
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
It was only used for the model._id -> model.id conversion and is not
needed anymore.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Add a lengthy comment explaining all the variants.
|
|
|
|
|
| |
This one seems to work nicely in all relevant situations.
See comments inside the source.
|
|
|
|
|
|
| |
_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.
|
| |
|
|
|
|
| |
run.
|
|\
| |
| |
| |
| |
| | |
* commit '9437ea4742':
Add commit argument to clean_orphan_tags
Add "commit" argument to Base model delete()
|
| |
| |
| |
| | |
So we can prevent the session from being committed if we don't want it.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
| |
Just force the passed in name to MigrationManager() to unicode.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
| |
Sends an HTTP POST request back to an URL given on submission to the API
submit view.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
instead of 'collections'
|
| |
|
|
|
|
|
| |
- Adapt tests to new global_config arg for run_dbupdate
- Account for [plugins] not being set in config
|
| |
|
|
|
|
|
| |
The __repr__() call would crash the process when it tried to convert an
unicode title to ASCII for terminal/logfile output.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
| |
This commit makes test_submission mostly warning-clean.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
'is_derek/bug405_email_notifications_for_comments' into notifications-merge
Conflicts:
mediagoblin/db/mongo/migrations.py
|
| |\
| | |
| | |
| | |
| | | |
Conflicts:
mediagoblin/db/mongo/migrations.py
|