From e61ab0998b77eaf18268001fd2d70917c3cd3e37 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sat, 4 Feb 2012 20:55:55 +0100 Subject: Drop pre-rendered html: User.bio_html 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. --- mediagoblin/db/sql/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/db/sql/convert.py') diff --git a/mediagoblin/db/sql/convert.py b/mediagoblin/db/sql/convert.py index f6575be9..a098927f 100644 --- a/mediagoblin/db/sql/convert.py +++ b/mediagoblin/db/sql/convert.py @@ -56,7 +56,7 @@ def convert_users(mk_db): copy_attrs(entry, new_entry, ('username', 'email', 'created', 'pw_hash', 'email_verified', 'status', 'verification_key', 'is_admin', 'url', - 'bio', 'bio_html', + 'bio', 'fp_verification_key', 'fp_token_expire',)) # new_entry.fp_verification_expire = entry.fp_token_expire -- cgit v1.2.3 From 1e72e075f8d542f4aa1ad0262f4fd1a5645cc731 Mon Sep 17 00:00:00 2001 From: Elrond Date: Mon, 13 Feb 2012 13:42:59 +0100 Subject: Drop pre-rendered html: MediaEntry.description_html 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. --- mediagoblin/db/sql/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/db/sql/convert.py') diff --git a/mediagoblin/db/sql/convert.py b/mediagoblin/db/sql/convert.py index a098927f..9d276866 100644 --- a/mediagoblin/db/sql/convert.py +++ b/mediagoblin/db/sql/convert.py @@ -77,7 +77,7 @@ def convert_media_entries(mk_db): new_entry = MediaEntry() copy_attrs(entry, new_entry, ('title', 'slug', 'created', - 'description', 'description_html', + 'description', 'media_type', 'state', 'license', 'fail_error', 'queued_task_id',)) -- cgit v1.2.3 From feba5c5287a7cb4c0ed8f5124ad60a8a291770ad Mon Sep 17 00:00:00 2001 From: Elrond Date: Sat, 18 Feb 2012 11:32:28 +0100 Subject: Drop pre-rendered html: MediaComment.content_html 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. --- mediagoblin/db/sql/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/db/sql/convert.py') diff --git a/mediagoblin/db/sql/convert.py b/mediagoblin/db/sql/convert.py index 9d276866..a46d62ea 100644 --- a/mediagoblin/db/sql/convert.py +++ b/mediagoblin/db/sql/convert.py @@ -133,7 +133,7 @@ def convert_media_comments(mk_db): new_entry = MediaComment() copy_attrs(entry, new_entry, ('created', - 'content', 'content_html',)) + 'content',)) copy_reference_attr(entry, new_entry, "media_entry") copy_reference_attr(entry, new_entry, "author") -- cgit v1.2.3 From cf27accc9e9f2d8eb0b697cb4cea801a388e7993 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sun, 12 Feb 2012 23:49:01 +0100 Subject: SQL: fail_metadata as JSON encoded field 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. --- mediagoblin/db/sql/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/db/sql/convert.py') diff --git a/mediagoblin/db/sql/convert.py b/mediagoblin/db/sql/convert.py index a46d62ea..14a0b911 100644 --- a/mediagoblin/db/sql/convert.py +++ b/mediagoblin/db/sql/convert.py @@ -79,7 +79,7 @@ def convert_media_entries(mk_db): ('title', 'slug', 'created', 'description', 'media_type', 'state', 'license', - 'fail_error', + 'fail_error', 'fail_metadata', 'queued_task_id',)) copy_reference_attr(entry, new_entry, "uploader") -- cgit v1.2.3 From a45631e3f3791071571da3a59bf6d3ecad42033f Mon Sep 17 00:00:00 2001 From: Elrond Date: Sat, 18 Feb 2012 11:00:13 +0100 Subject: Start having useful defaults for SQL 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 --- mediagoblin/db/sql/convert.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mediagoblin/db/sql/convert.py') diff --git a/mediagoblin/db/sql/convert.py b/mediagoblin/db/sql/convert.py index 14a0b911..36d6fc7f 100644 --- a/mediagoblin/db/sql/convert.py +++ b/mediagoblin/db/sql/convert.py @@ -148,8 +148,7 @@ def convert_media_comments(mk_db): def main(): global_config, app_config = setup_global_and_app_config("mediagoblin.ini") - sql_conn, sql_db = sql_connect({'sql_engine': 'sqlite:///mediagoblin.db'}) - + sql_conn, sql_db = sql_connect(app_config) mk_conn, mk_db = mongo_connect(app_config) Base.metadata.create_all(sql_db.engine) -- cgit v1.2.3