| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
1. Make the foreignkey the primary_key.
2. Add width/height, as those are currently in use for the
media_data
|
|
|
|
|
|
|
|
|
|
|
| |
It's good practice to cleanup the SQL session after each
request so that the next request gets a fresh one.
It's an application decision whether one wants a
just-in-case ROLLBACK or COMMIT. There are two ideas behind
it, really. I have decided for ROLLBACK. The idea is "if
you forget to commit your changes yourself, there's
something broken. Maybe you got an exception?".
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
- Various fixes to dbupdate itself
- Switching db/sql/migrations.py to use a dict instead of a list
- Registering the function
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
Let the init code also handle createing a fresh clean
instance without any attrs set.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\|
| |
| |
| |
| | |
Conflicts:
mediagoblin/db/sql/models.py
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
- 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
|
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Actually, I'm not even sure *that* is ideal! But better than what we
had...
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
- MigrationRecord to MigrationData, again
- If the table doesn't exist, return None for database_current_migration
- database.engine -> database.bind
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Thanks again Elrond.
|
| |
| |
| |
| | |
self.database -> self.database.engine (thanks again Elrond for the catch)
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Added methods:
- migration_data
- database_current_migration
- migrations_to_run
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
| |
Things definitely don't work yet, but should be heading in the right direction.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
The base class of all models "Base" should be in base.py.
|