From 04d925802036440561b21ac9f1437ada7dfab02f Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Fri, 20 Jan 2017 14:54:29 -0500 Subject: [PATCH 1/3] add migrations package (#22) --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index d4dbf82..6246227 100644 --- a/setup.py +++ b/setup.py @@ -34,6 +34,7 @@ setup( license="MIT License", packages=[ "dbfilestorage", + "dbfilestorage.migrations", ], include_package_data=True, install_requires=[ From f6f606c217e9460abefdd3e08f01425624b5e6a0 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Fri, 20 Jan 2017 14:55:39 -0500 Subject: [PATCH 2/3] add migrations --- README.md | 1 + docs/conf.py | 4 ++-- setup.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3d93d72..0d6b062 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ I will sign everything with 0x769A1BC78A2DDEE2 ## CHANGELOG +- 2017-01-20 [Tyrel Souza] Make sure migrations is actually there. - 2017-01-20 [Tyrel Souza] Split filename and filehash. - 2016-12-09 [Tyrel Souza] Add signing key to readme. - 2016-12-09 [Tyrel Souza] Update Tests, add some cleanup. diff --git a/docs/conf.py b/docs/conf.py index 5cde4f3..ec3df25 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,9 +54,9 @@ author = u'Tyrel Souza' # built documents. # # The short X.Y version. -version = u'0.1.4' +version = u'0.1.5' # The full version, including alpha/beta/rc tags. -release = u'0.1.4' +release = u'0.1.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index 6246227..b5f837d 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ class CleanCommand(Command): setup( name="django-dbfilestorage", - version="0.1.4", + version="0.1.5", description="Database backed file storage for testing.", long_description="Database backed file storage for testing. Stores files as base64 encoded textfields.", author="Tyrel Souza", From 76d095991c009c37338fe1b1eaf55ea822206bbe Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Fri, 20 Jan 2017 15:09:09 -0500 Subject: [PATCH 3/3] alter first, then add --- .../migrations/0002_add_filehash_rename_files.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dbfilestorage/migrations/0002_add_filehash_rename_files.py b/dbfilestorage/migrations/0002_add_filehash_rename_files.py index 4eca219..7d3666b 100644 --- a/dbfilestorage/migrations/0002_add_filehash_rename_files.py +++ b/dbfilestorage/migrations/0002_add_filehash_rename_files.py @@ -27,17 +27,18 @@ class Migration(migrations.Migration): ] operations = [ + migrations.AlterField( + model_name='dbfile', + name='name', + field=models.CharField(max_length=100), + ), migrations.AddField( model_name='dbfile', name='filehash', field=models.CharField(default='filehash', max_length=32, primary_key=True, serialize=False), preserve_default=False, ), - migrations.AlterField( - model_name='dbfile', - name='name', - field=models.CharField(max_length=100), - ), + migrations.RunPython(copy_filehash), migrations.RunPython(fix_filename), ]