David-Wobrock
f9dc725e00
Split documentation to multiple files in docs/ and use markdown
2020-01-11 22:35:20 +01:00
David Wobrock
813c5c8690
Remove apache license headers in each file. The one full copy of the license at the root of the repo shall define the license for all source files.
2020-01-11 22:08:33 +01:00
David Wobrock
b91c0c62db
Update README.rst
...
Correct the verbosity parameter
2019-12-02 13:50:40 +01:00
David Wobrock
948717f6e4
Bump to version 1.4.1
2019-12-01 11:37:14 +01:00
David Wobrock
18fa3bdb7a
Update testing dependencies (mysqlclient, do not let Django 2.2 overlap to 3.0 under dev, and update black)
2019-12-01 11:36:56 +01:00
David Wobrock
e57abd292f
Bump to version 1.4.0
2019-10-21 22:30:21 +02:00
David Wobrock
8ebfe4c605
Update all other test dependencies to last status
2019-10-21 22:28:44 +02:00
David Wobrock
22b7d0c02d
Update tox dep to latest (3.14.0)
2019-10-21 22:28:44 +02:00
David Wobrock
abb2971741
Update CHANGELOG with Python3.8 addition
2019-10-21 22:28:44 +02:00
David Wobrock
804c35c2d6
Add Python3.8 to Travis, tox and setup.py files
2019-10-21 22:28:44 +02:00
David Wobrock
c036a67346
Update CHANGELOG with table and column detection
2019-10-21 22:27:25 +02:00
David Wobrock
1d9f4b7b86
Make sqlite and mysql table and column detection a little bit more resilient for UX
2019-10-21 22:27:25 +02:00
David Wobrock
a31282a4d8
Make base detection of table and column more resilient
2019-10-21 22:27:25 +02:00
David Wobrock
7fad69659c
Refactor: move build_error_dict into the Analyser call, since it will be backend specific
2019-10-21 22:27:25 +02:00
David Wobrock
18c271101d
Refactor: remove redundant function call
2019-10-21 22:27:25 +02:00
David Wobrock
9a4951f86d
Add 'enum34' dep for a Python version previous to 3.4 (for 2.7 mostly)
2019-10-21 22:25:52 +02:00
David Wobrock
d7eb85709d
Add 'quiet' option to README and CHANGELOG
2019-10-21 22:25:52 +02:00
David Wobrock
ceabb40a62
Change migration linting prints to use conditined methods
2019-10-21 22:25:52 +02:00
David Wobrock
3b8e86fdf7
Add 'quiet' to argparsing and pass it to the linter
2019-10-21 22:25:52 +02:00
David Wobrock
72f066e710
Add MessageType enum for differentiating messages
2019-10-21 22:25:52 +02:00
David Wobrock
75be4d4258
Update CHANGELOG with many to many field handling
2019-10-21 22:25:01 +02:00
David Wobrock
537542b30d
Add manytomany app to test project and integration tests
2019-10-21 22:25:01 +02:00
David Wobrock
ca6b623200
Add unused app with manytomany field
2019-10-21 22:25:01 +02:00
David Wobrock
cbc5a623b0
Add unit tests on adding many to many field (by testing SQL directly)
2019-10-21 22:25:01 +02:00
David Wobrock
b252c203f5
Add logic that adding a unique constraint is only an error when the table has not been created in the same transaction
2019-10-21 22:25:01 +02:00
David Wobrock
6e64e447a9
Update CHANGELOG and README with --include-migrations-from info
2019-10-12 16:01:01 +02:00
David Wobrock
e6e8cc7525
Update migrations list file behaviour
...
Instead of using the file path when the git commit is not
added, use the file and the migrations list no matter if we select
all migrations or just from a certain git commit.
And unit tests :)
2019-10-12 15:53:18 +02:00
David Wobrock
14cafd017d
Bump to version 1.3.0
2019-07-30 10:47:58 +02:00
David Wobrock
5c5507a4c3
Also catch specific mysql errors during sqlmigrate
2019-07-30 10:47:20 +02:00
David Wobrock
c57d3c9286
Update README and CHANGELOG
2019-07-30 10:47:20 +02:00
David Wobrock
a74a7497ad
Catch exception if sqlmigrate fails
...
Because of missing constraint that Django cannot find and therefore drop.
2019-07-30 10:47:20 +02:00
David Wobrock
e408cd2c5e
Add SQL analyser logic for adding unique constraint
2019-07-30 10:47:20 +02:00
David Wobrock
652031ce8d
Add failing tests for unique_together condition
2019-07-30 10:47:20 +02:00
David Wobrock
8aac58abbe
Add app for unique together testing
2019-07-30 10:47:20 +02:00
David Wobrock
00826d399a
Update README and CHANGELOG
2019-07-29 23:14:30 +02:00
David Wobrock
f597df779b
Black test app migration
2019-07-29 23:14:30 +02:00
David Wobrock
4128c4b018
Add logic to detect DROP TABLE
2019-07-29 23:14:30 +02:00
David Wobrock
fc7a81e719
Update changelog
2019-07-29 21:05:12 +02:00
David Wobrock
eac9c5615f
Refactor sql_analyser into multiple classes for simpler extension in the future
2019-07-29 21:05:12 +02:00
David Wobrock
19620d9996
Handle other strategy for sqlite in Django2.2
2019-07-29 21:05:12 +02:00
David Wobrock
ef2052a7b0
Work on SQL Analyser module
...
* With database specific functions
* Functions that analyse the entire transaction
* Unit tests that only test this module
2019-07-29 21:05:12 +02:00
David Wobrock
d02df5d20f
Black migration file
2019-07-29 21:05:12 +02:00
David Wobrock
801096ece8
Clone the entire repo. The default=50 is now not going far enough for the unit tests (which use git tags)
2019-07-28 12:28:56 +02:00
David Wobrock
19e54bba09
Refactor duplicated code in sql_analyser
2019-07-28 12:28:56 +02:00
David Wobrock
43dc2dcabd
Lock lint dependencies
2019-07-28 12:28:56 +02:00
David Wobrock
7215afa4a4
Fix line too long (flake8)
2019-07-28 12:28:56 +02:00
David Wobrock
85b9abdbc3
Display information that a problem has been found but ignored (and therefore the migration is considered ok)
2019-07-28 12:28:56 +02:00
David Wobrock
aa8043db74
Add unit test for exclude migration tests
2019-07-28 12:28:56 +02:00
David Wobrock
af4b11c563
Document (README & CHANGELOG) and rename option to 'exclude-migration-tests'
2019-07-28 12:28:56 +02:00
David Wobrock
e93d4ec4c7
Bump to version 1.2.0 and update CHANGELOG.md
2019-07-10 10:26:42 +02:00
David Wobrock
83850fa3da
Update README: document 'applied-migrations' and 'unapplied-migrations' options
2019-06-06 22:54:08 +02:00
David Wobrock
5561a308a3
Add tests for ignore applied/unapplied migrations
2019-06-06 22:54:08 +02:00
David Wobrock
19fe5b75fe
Add logic to ignore applied or unapplied migrations
2019-06-06 22:54:08 +02:00
David Wobrock
ba0704ef3a
Always load migrations from database:
...
This enables us to detect if a migration has been applied to a certain database.
No matter if the migrations and detected from git or all, we always match them with the migrations found by Django.
2019-06-06 22:54:08 +02:00
David Wobrock
3273f1bdc4
Add exclusive options for linting only applied or unapplied migrations
2019-06-06 22:54:08 +02:00
David Wobrock
b17c872996
Update README: consistent command line options and remove obsolete option
2019-06-06 22:54:08 +02:00
David Wobrock
42a83f18a0
Bump version to 1.1.0 and add note in CHANGELOG
2019-05-19 22:51:54 +02:00
David Wobrock
9d5f16c0b1
Update README: add note on how I usually publish the package
2019-05-19 22:51:53 +02:00
David Wobrock
e948a93399
Update README: remove the code-block for the Operation SQL
2019-05-19 22:42:43 +02:00
David Wobrock
e23e46e3d4
IgnoreMigrationOp: add class comment to explain purpose of no-op
2019-05-19 22:32:41 +02:00
David Wobrock
e7b3361984
Nitpick: rename function back to easier understandable name
2019-05-19 22:30:51 +02:00
David Wobrock
60eab0aba3
Add author_email (my own (David Wobrock) for now) and fix an error in the readme rst
2019-05-12 15:57:49 +02:00
David Wobrock
3b2b2f91c2
Clean up unused code and comments
2019-05-12 15:50:03 +02:00
David Wobrock
f51daab1c2
Update README.rst
...
Make code-block appear in GitHub (because of missing space)
2019-05-12 15:40:30 +02:00
David Wobrock
a5f83837d1
Add support for Django 2.2 (by testing it in the CI)
2019-05-12 15:32:57 +02:00
David Wobrock
c4e6251b53
Update CHANGELOG.md
...
* add fixed bugs for coming 1.0.0*
* fix some typo and 'styling'
2019-05-12 15:32:57 +02:00
David Wobrock
0f1030d43a
Add non-regression test:
...
Tests that running the linter a second time by ignoring an erroneous migration
will not hit the cache for the said migration.
Instead, it is correctly ignored.
2019-05-12 15:32:57 +02:00
David Wobrock
42d43fd6aa
Update README and add CHANGELOG file
2019-05-12 15:32:57 +02:00
David Wobrock
e45e031820
Bump to 1.0.0 and update setup.py to drop command line usage
2019-05-12 15:32:57 +02:00
David Wobrock
5390fd507f
Update Tests:
...
* don't use the project fixtures anymore but the one Django project
* update and refactor cache tests to be less brittle
* explicitly test mysql, postgresql and sqlite3 databases
* remove 'multiple_call' tests since it is not possible anymore
(with the Django singleton)
* update Travis and tox (dropping Python 3.4)
2019-05-12 15:32:57 +02:00
David Wobrock
f35c9177f4
Delete examples folder since it is not relevant anymore
2019-05-12 15:32:57 +02:00
David Wobrock
484a775fda
Linter Core: change lots of behaviour
...
* Use the Django migration classes to manipulate these objects
this includes the discovery of migrations through the MigrationLoader
(instead of manually walking through the Django project and find the migrations through a regex)
and representing a Migration through the Django class.
* Get the SQL of a migration through a 'call_command' call of 'sqlmigrate'
That speeds up greatly the linter since we don't have to setup Django for each migration
* Add the database to the cache path
2019-05-12 15:32:57 +02:00
David Wobrock
0eb584889a
Add Django management command to launch the linter
2019-05-12 15:32:57 +02:00
David Wobrock
f05a986973
Update .gitignore: remove fixture and add some stuff
2019-05-12 15:32:57 +02:00
David Wobrock
26ed4ecf62
Tests: add test project
...
* manage.py file at the root of the project
* targetting the project located at tests/test_project/settings.py
That allows testing the linter through just calling it on the project itself.
Using the new method coming soon: `python manage.py lintmigrations`
2019-05-12 15:32:57 +02:00
David Wobrock
fdd6b9b06a
Tests: Delete all fixture Django projects
...
We won't need all these different django projects to test the linter.
That adds up to much complexity to the tests.
2019-05-12 15:32:57 +02:00
David Wobrock
64c54b72d4
Bump to version 0.1.5
2019-04-21 12:53:13 +02:00
David-Wobrock
1245e7939d
Bump to version 0.1.4
2019-02-24 18:19:49 +01:00
David-Wobrock
36e7dfaa0e
Do not create cache folder if no-cache option
2019-02-24 18:18:45 +01:00
David-Wobrock
c3c1af113c
Handle postgresql alter column type
...
ALTER TABLE table ALTER COLUMN column TYPE
2019-02-24 15:55:05 +01:00
David-Wobrock
999ee2fa5e
unrelated: fix some warnings and redundant elements
2019-02-24 15:55:05 +01:00
David-Wobrock
5c7dab8db2
Update linter tests for multiple backends
...
Create a base test class and have 3 different backends for now:
* mysql
* sqlite3
* postgresql
2019-02-24 15:55:05 +01:00
David-Wobrock
ba83526339
Fix caching tests issues on Windows
2019-02-24 15:55:05 +01:00
David-Wobrock
f5a587c2be
Fix split path function
...
So it also works on windows
and does not return empty stuff
and update tests
2019-02-24 15:55:05 +01:00
David-Wobrock
c403754564
Add blog post to readme
...
The article written by Felix about the linter and handling backward
incompatible migrations in Django
2019-02-24 15:55:05 +01:00
David-Wobrock
f8d9ab777a
Do not manually retrieve python interpreter path
...
Instead of doing custom and wrong path detection, just
use sys.executable which does exactly that
2019-02-24 11:04:21 +01:00
David-Wobrock
3591a4422a
Bump to version 0.1.3
2019-02-03 19:39:31 +01:00
David Wobrock
d22401f101
Add tests for version option
...
From Python 3.4 on, version is printed on stdout instead
of stderr.
2019-02-03 19:38:38 +01:00
David Wobrock
fea623630e
Add --version option
2019-02-03 19:38:38 +01:00
David Wobrock
4d68f7bac8
Bump version to 0.1.2
2019-01-21 22:08:57 +01:00
David Wobrock
4c5d12800e
Add in the readme what is looked for by the linter
2019-01-21 22:03:17 +01:00
David Wobrock
1a9024e799
add test for git on non root location
2019-01-20 12:17:11 +01:00
David Wobrock
009153fbf4
handle linting a project in pwd
...
When calling "django-migration-linter ."
be able to handle it (especially with cache)
2019-01-20 12:17:11 +01:00
David Wobrock
75c969c6a9
Revert "don't assume git root is django_path"
...
This reverts commit c14f9aef37 .
2019-01-20 11:46:30 +01:00
David-Wobrock
f52bb3d9b8
Bump version to 0.1.1
2019-01-07 19:37:51 +01:00
David-Wobrock
7a34ac9010
Fix tests and git migration gathering
2019-01-05 17:39:09 +01:00
David-Wobrock
c6df7e53a0
Add Migration class to hold the path, app name and migration name in one object + adapt existing logic
2019-01-05 16:59:36 +01:00
David-Wobrock
f0021dc139
Add test migration in folder
2019-01-04 22:00:19 +01:00
David-Wobrock
574af4b7fe
Do not check if .git folder exists
...
git commands will fail anyway if not present
2019-01-04 21:42:39 +01:00
David-Wobrock
99534e4eb9
Bump version to 0.1.0 and set to dev status Beta
2019-01-03 22:13:37 +01:00