Commit Graph
18 Commits
Author SHA1 Message Date
David Wobrock 2ee7dac3b3 Add internal classes and add type hints + mypy. 2022-12-26 16:26:24 +01:00
David Wobrock e8f83708b0 Run black. 2022-11-03 22:00:00 +01:00
Sondre Lillebø Gundersen bd4eb89b8c chore: Upgrade Python syntax with pyupgrade
Run with the following pre-commit configuration:

```
repos:
  - repo: https://github.com/asottile/pyupgrade
    rev: v3.1.0
    hooks:
      - id: pyupgrade
        args: [ "--py3-plus", "--py36-plus", "--py37-plus" ]
```

The rationale for every change can be found at https://github.com/asottile/pyupgrade
2022-11-03 22:00:00 +01:00
David Wobrock 3219f9cf8a Handle creating a unique index as adding a unique constraint 2022-01-28 21:23:44 +01:00
Christian Bundy 397c1f0e16 Default ends_with_default to False
Problem: Previously in gh-117 we aimed to solve gh-115, which described a problem where we used `SET DEFAULT` and then `DROP DEFAULT` immediately afterward. The solution was to track whether any defaults are retained, but the `ends_with_default` variable is initialized as `None` rather than `False`. At the end of the function we check whether `ends_with_default is False`, never occurs unless a default is set.

Solution: Assume that there is no default unless proven otherwise, and iniitializie `ends_with_default` to `False` instead of `None`.

Fixes: gh-158
2021-08-14 15:22:24 +02:00
David Wobrock fa56196f04 Add PG reindex linting warning and improve some smaller stuff 2021-06-19 18:15:40 +02:00
David Wobrock 9ea8872a29 Add warnings type to SQL analyser 2021-06-19 18:15:40 +02:00
David-Wobrock e51073ef46 Fixes #129 - use single logger 2020-11-30 21:53:38 +01:00
David Wobrock b3816613d5 Fix #115 -- Detect correctly if a field ends with a default value or a dropped default 2020-06-20 18:08:16 +02:00
David Wobrock 71614bd377 Handle warning as error and exclude warning tests 2020-02-07 23:29:15 +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 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 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 e408cd2c5e Add SQL analyser logic for adding unique constraint 2019-07-30 10:47:20 +02:00
David Wobrock 4128c4b018 Add logic to detect DROP TABLE 2019-07-29 23:14:30 +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