aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql/convert.py
Commit message (Collapse)AuthorAgeFilesLines
* Check that the media_data tables are empty.Elrond2012-04-021-1/+8
| | | | | In the analyzing part also check that the media_data tables are empty (as expected) before dropping them.
* Add ascii and audio tables/migration data.Elrond2012-04-021-1/+3
| | | | Well, and if it's not needed, drop it again. ;)
* Cleanup unused media_data tables and migration info.Elrond2012-04-021-6/+34
| | | | | | 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.
* Mongo -> SQL conversion tool: UI improvementsElrond2012-04-021-16/+28
| | | | | | Output some headers while converting things. And indent some info. Also some DRY things.
* Fixed an issue where orphaned comments breaks the importJoar Wandborg2012-04-021-5/+11
|
* Fix some simple errors.Elrond2012-03-291-2/+2
|
* Change models to a _v0 suffix.Elrond2012-03-291-9/+8
| | | | | And add the image and video media_data tables. And start to rewrite the convert tool.
* Cleanup mongo->sql converter.Elrond2012-03-251-5/+2
| | | | | | | | 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 "Base" from base instead of models.Elrond2012-03-201-2/+2
| | | | | Import the "Base" class for models from db.sql.base instead of db.sql.models.
* Let convert_mongo_to_sql add Migration RecordsElrond2012-03-171-1/+17
| | | | | | | | | | 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.
* Convert (gps) image media_data.Elrond2012-03-141-0/+23
| | | | | | 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.
* Fix VideoData insertionChristopher Allan Webber2012-03-141-1/+1
|
* Convert media_data for videoElrond2012-03-131-0/+15
| | | | | This creates fresh VideoData rows for all the videos in the mongodb.
* SQL: Improve video media_data tableElrond2012-03-011-0/+1
| | | | | | 1. Make the foreignkey the primary_key. 2. Add width/height, as those are currently in use for the media_data
* Attachment support in the SQL backendElrond2012-02-281-1/+10
| | | | | | | | | 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
* 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.
* 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
* SQL: fail_metadata as JSON encoded fieldElrond2012-02-181-1/+1
| | | | | | | | 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.
* Drop pre-rendered html: MediaComment.content_htmlElrond2012-02-181-1/+1
| | | | | | | | | | | 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-181-1/+1
| | | | | | | | | | | 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-181-1/+1
| | | | | | | | | | | 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.
* Fix copyright statements; add LICENSE for EXIF.pyWill Kahn-Greene2012-02-081-1/+1
|
* Convert over the license field, too!Christopher Allan Webber2012-01-211-1/+1
|
* Add copyright header and a bit of pep8ificationElrond2012-01-201-0/+17
| | | | | | Nearly all the sql files missed a copyright header. So added it! And while there fixed a few pep8 things.
* Add MediaFile table and related infrastructure.Elrond2012-01-111-1/+6
| | | | | | | | | | | | - 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.
* sql convert: Use more library functionsElrond2012-01-011-11/+9
| | | | | | | | | | 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.
* SQL Model: Forgot MediaEntry.state fieldElrond2011-12-281-1/+1
| | | | | | | | 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?
* SQL: mongokit like interfaceElrond2011-12-181-1/+6
| | | | | | | | 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
* Simple Mongo -> SQL migration toolElrond2011-12-171-0/+143
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