| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
In the analyzing part also check that the media_data tables
are empty (as expected) before dropping them.
|
|
|
|
| |
Well, and if it's not needed, drop it again. ;)
|
|
|
|
|
|
| |
After converting everything, check what is actually used in
the db. For media_types that are not used, drop all the
media_data tables and remove the migration info.
|
|
|
|
|
|
| |
Output some headers while converting things.
And indent some info.
Also some DRY things.
|
| |
|
| |
|
|
|
|
|
| |
And add the image and video media_data tables.
And start to rewrite the convert tool.
|
|
|
|
|
|
|
|
| |
1. No need to drop media_data['exif'], we only have and
want media_data['exif_all'].
2. Use media['_id'] instead of media._id (better not use
dot-notation on mongo objects in such a low level tool).
|
|
|
|
|
| |
Import the "Base" class for models from db.sql.base instead
of db.sql.models.
|
|
|
|
|
|
|
|
|
|
| |
The mongosql tool is really dumping directly into the sql
database and is trying not to use too much logic that might
change later.
So this means, it needs to create the migration records on
its own!
So add a bunch of records with version=0.
|
|
|
|
|
|
| |
Add mongo_to_sql convert part for converting the media_data
for images. This currently drops the exif data and thus
only converts gps data.
|
| |
|
|
|
|
|
| |
This creates fresh VideoData rows for all the videos in the
mongodb.
|
|
|
|
|
|
| |
1. Make the foreignkey the primary_key.
2. Add width/height, as those are currently in use for the
media_data
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
Nearly all the sql files missed a copyright header.
So added it!
And while there fixed a few pep8 things.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
While creating the new SQL model, the "state" field of
MediaEntry was left out. Currently using a plain unicode
string for it.
Maybe should use sqlalchemy.types.Enum?
|
|
|
|
|
|
|
|
| |
In trying to ease the migration to SQL, created an
interface to sqlalchemy that looks a lot like the interface
that is currently in use.
*WARNING* Work in progress
|
|
This is just a start at a Migration tool from Mongo to SQL.
It fills all currently available SQL models with data from
MongoDB. A few fields in the SQL tables are left out,
because some data format migrations are needed (notably:
queue_file_name).
This thing lives in mediagoblin/db/sql/convert.py because
it has a lot of stuff hardcoded and is not, repeat not for
end users!
Hard coded:
- output database: ./mediagoblin.db (sqlite)
- Mediagoblin config: ./mediagoblin.ini
|