plain.postgres 0.89.0__tar.gz → 0.89.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/PKG-INFO +1 -1
  2. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/CHANGELOG.md +18 -8
  3. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/cli/schema.py +7 -4
  4. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/dialect.py +1 -1
  5. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/pyproject.toml +1 -1
  6. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/.gitignore +0 -0
  7. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/CLAUDE.md +0 -0
  8. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/LICENSE +0 -0
  9. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/README.md +0 -0
  10. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/README.md +0 -0
  11. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/__init__.py +0 -0
  12. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/agents/.claude/rules/plain-postgres.md +0 -0
  13. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/agents/.claude/skills/plain-postgres-diagnose/SKILL.md +0 -0
  14. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/aggregates.py +0 -0
  15. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/backups/__init__.py +0 -0
  16. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/backups/cli.py +0 -0
  17. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/backups/clients.py +0 -0
  18. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/backups/core.py +0 -0
  19. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/base.py +0 -0
  20. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/cli/__init__.py +0 -0
  21. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/cli/core.py +0 -0
  22. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/cli/diagnose.py +0 -0
  23. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/cli/migrations.py +0 -0
  24. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/config.py +0 -0
  25. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/connection.py +0 -0
  26. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/connections.py +0 -0
  27. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/constants.py +0 -0
  28. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/constraints.py +0 -0
  29. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/database_url.py +0 -0
  30. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/db.py +0 -0
  31. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/default_settings.py +0 -0
  32. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/deletion.py +0 -0
  33. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/diagnose/__init__.py +0 -0
  34. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/diagnose/checks.py +0 -0
  35. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/diagnose/context.py +0 -0
  36. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/diagnose/tables.py +0 -0
  37. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/diagnose/types.py +0 -0
  38. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/entrypoints.py +0 -0
  39. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/enums.py +0 -0
  40. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/exceptions.py +0 -0
  41. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/expressions.py +0 -0
  42. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/fields/__init__.py +0 -0
  43. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/fields/encrypted.py +0 -0
  44. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/fields/json.py +0 -0
  45. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/fields/mixins.py +0 -0
  46. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/fields/related.py +0 -0
  47. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/fields/related_descriptors.py +0 -0
  48. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/fields/related_lookups.py +0 -0
  49. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/fields/related_managers.py +0 -0
  50. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/fields/reverse_descriptors.py +0 -0
  51. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/fields/reverse_related.py +0 -0
  52. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/fields/timezones.py +0 -0
  53. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/forms.py +0 -0
  54. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/functions/__init__.py +0 -0
  55. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/functions/comparison.py +0 -0
  56. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/functions/datetime.py +0 -0
  57. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/functions/math.py +0 -0
  58. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/functions/mixins.py +0 -0
  59. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/functions/text.py +0 -0
  60. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/functions/window.py +0 -0
  61. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/indexes.py +0 -0
  62. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/lookups.py +0 -0
  63. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/meta.py +0 -0
  64. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/__init__.py +0 -0
  65. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/autodetector.py +0 -0
  66. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/exceptions.py +0 -0
  67. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/executor.py +0 -0
  68. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/graph.py +0 -0
  69. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/loader.py +0 -0
  70. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/migration.py +0 -0
  71. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/operations/__init__.py +0 -0
  72. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/operations/base.py +0 -0
  73. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/operations/fields.py +0 -0
  74. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/operations/models.py +0 -0
  75. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/operations/special.py +0 -0
  76. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/optimizer.py +0 -0
  77. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/questioner.py +0 -0
  78. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/recorder.py +0 -0
  79. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/serializer.py +0 -0
  80. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/state.py +0 -0
  81. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/utils.py +0 -0
  82. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/migrations/writer.py +0 -0
  83. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/options.py +0 -0
  84. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/otel.py +0 -0
  85. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/preflight.py +0 -0
  86. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/query.py +0 -0
  87. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/query_utils.py +0 -0
  88. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/registry.py +0 -0
  89. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/schema.py +0 -0
  90. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/sql/__init__.py +0 -0
  91. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/sql/compiler.py +0 -0
  92. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/sql/constants.py +0 -0
  93. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/sql/datastructures.py +0 -0
  94. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/sql/query.py +0 -0
  95. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/sql/where.py +0 -0
  96. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/test/__init__.py +0 -0
  97. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/test/pytest.py +0 -0
  98. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/test/utils.py +0 -0
  99. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/transaction.py +0 -0
  100. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/types.py +0 -0
  101. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/types.pyi +0 -0
  102. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/plain/postgres/utils.py +0 -0
  103. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/app/examples/migrations/0001_initial.py +0 -0
  104. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/app/examples/migrations/0002_test_field_removed.py +0 -0
  105. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/app/examples/migrations/0003_deleteparent_childsetnull_childsetdefault_and_more.py +0 -0
  106. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/app/examples/migrations/0004_defaultquerysetmodel_mixintestmodel_and_more.py +0 -0
  107. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/app/examples/migrations/0005_feature_carfeature_car_features.py +0 -0
  108. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/app/examples/migrations/0006_secretstore.py +0 -0
  109. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/app/examples/migrations/__init__.py +0 -0
  110. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/app/examples/models.py +0 -0
  111. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/app/settings.py +0 -0
  112. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/app/urls.py +0 -0
  113. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_connection_isolation.py +0 -0
  114. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_connection_lifecycle.py +0 -0
  115. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_database_url.py +0 -0
  116. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_delete_behaviors.py +0 -0
  117. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_encrypted_fields.py +0 -0
  118. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_exceptions.py +0 -0
  119. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_iterator.py +0 -0
  120. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_manager_assignment.py +0 -0
  121. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_models.py +0 -0
  122. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_read_only_transactions.py +0 -0
  123. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_related_descriptors.py +0 -0
  124. {plain_postgres-0.89.0 → plain_postgres-0.89.1}/tests/test_related_manager_api.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.postgres
3
- Version: 0.89.0
3
+ Version: 0.89.1
4
4
  Summary: Model your data and store it in a database.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-Expression: BSD-3-Clause
@@ -1,5 +1,17 @@
1
1
  # plain-postgres changelog
2
2
 
3
+ ## [0.89.1](https://github.com/dropseed/plain/releases/plain-postgres@0.89.1) (2026-03-26)
4
+
5
+ ### What's changed
6
+
7
+ - Fixed `schema` command type mismatches for `time`, `timestamp`, and `DecimalField` types that caused false drift reports ([187e39e3faeb](https://github.com/dropseed/plain/commit/187e39e3faeb))
8
+ - Fixed `schema` command crash on expression-based unique constraints (e.g. `UniqueConstraint` with `expressions` instead of `fields`) ([187e39e3faeb](https://github.com/dropseed/plain/commit/187e39e3faeb))
9
+ - Improved 0.89.0 upgrade instructions with clearer ordering and step descriptions ([a59062327ed5](https://github.com/dropseed/plain/commit/a59062327ed5), [c0520bdca709](https://github.com/dropseed/plain/commit/c0520bdca709))
10
+
11
+ ### Upgrade instructions
12
+
13
+ - No changes required.
14
+
3
15
  ## [0.89.0](https://github.com/dropseed/plain/releases/plain-postgres@0.89.0) (2026-03-25)
4
16
 
5
17
  ### What's changed
@@ -11,11 +23,11 @@
11
23
 
12
24
  ### Upgrade instructions
13
25
 
14
- **FK index migration — required for all FK fields:**
26
+ 1. Remove any `db_index=False` from FK fields in models and migration files the parameter no longer exists.
15
27
 
16
- 1. For each `ForeignKeyField` in your models, check if it's covered by an explicit `Index` or `UniqueConstraint` (with the FK as the leading field). Most FK columns should have an index.
28
+ 2. For each `ForeignKeyField`, check if it's covered by an explicit `Index` or `UniqueConstraint` (with the FK as the leading field). Most FK columns should have an index.
17
29
 
18
- 2. **If uncovered**, add an explicit index:
30
+ 3. **If uncovered**, add an explicit index:
19
31
 
20
32
  ```python
21
33
  model_options = postgres.Options(
@@ -25,7 +37,7 @@
25
37
  )
26
38
  ```
27
39
 
28
- 3. Run `makemigrations`. This generates an `AddIndex` migration. Before the `AddIndex` operation, add a `RunSQL` to drop the orphan auto-index left behind by the old `db_index=True` default:
40
+ 4. Run `makemigrations`. Before the `AddIndex` operation, add a `RunSQL` to drop the orphan auto-index left behind by the old `db_index=True` default:
29
41
 
30
42
  ```python
31
43
  operations = [
@@ -34,9 +46,9 @@
34
46
  ]
35
47
  ```
36
48
 
37
- The old auto-index name can be reconstructed using `_create_index_name(table, [column])` from the schema editor, or found by running `plain postgres schema --check`.
49
+ The old auto-index name follows the pattern `{table}_{column}_{hash}`. Find orphan names by running `plain postgres schema`.
38
50
 
39
- 4. **If already covered** by a composite index or unique constraint, the orphan auto-index is just wasted space. Generate a migration to drop it:
51
+ 5. **If already covered** by a composite index or unique constraint, the orphan auto-index is redundant. Generate a migration to drop it:
40
52
 
41
53
  ```python
42
54
  operations = [
@@ -44,8 +56,6 @@
44
56
  ]
45
57
  ```
46
58
 
47
- 5. Remove any `db_index=False` from FK fields in models and migration files — the parameter no longer exists.
48
-
49
59
  6. Run `migrate`.
50
60
 
51
61
  ## [0.88.2](https://github.com/dropseed/plain/releases/plain-postgres@0.88.2) (2026-03-25)
@@ -19,6 +19,8 @@ _TYPE_ALIASES: dict[str, str] = {
19
19
  "int8": "bigint",
20
20
  "float4": "real",
21
21
  "float8": "double precision",
22
+ "time": "time without time zone",
23
+ "timestamp": "timestamp without time zone",
22
24
  "timestamptz": "timestamp with time zone",
23
25
  "timetz": "time with time zone",
24
26
  "serial": "integer",
@@ -172,9 +174,7 @@ def _show_model(conn: Any, cursor: Any, model: Any) -> int:
172
174
 
173
175
  # Unique constraints
174
176
  model_constraints = [
175
- c
176
- for c in model.model_options.constraints
177
- if isinstance(c, UniqueConstraint) and c.fields
177
+ c for c in model.model_options.constraints if isinstance(c, UniqueConstraint)
178
178
  ]
179
179
  extra_constraints = actual_unique.keys() - {c.name for c in model_constraints}
180
180
 
@@ -183,7 +183,10 @@ def _show_model(conn: Any, cursor: Any, model: Any) -> int:
183
183
  click.secho(" Constraints:", dim=True)
184
184
 
185
185
  for constraint in model_constraints:
186
- fields_str = ", ".join(constraint.fields)
186
+ if constraint.fields:
187
+ fields_str = ", ".join(constraint.fields)
188
+ else:
189
+ fields_str = "expressions"
187
190
  click.echo(f" {constraint.name} UNIQUE ({fields_str})", nl=False)
188
191
 
189
192
  if constraint.name not in actual_unique:
@@ -109,7 +109,7 @@ DATA_TYPES: dict[str, Any] = {
109
109
  "CharField": _get_varchar_column,
110
110
  "DateField": "date",
111
111
  "DateTimeField": "timestamp with time zone",
112
- "DecimalField": "numeric(%(max_digits)s, %(decimal_places)s)",
112
+ "DecimalField": "numeric(%(max_digits)s,%(decimal_places)s)",
113
113
  "DurationField": "interval",
114
114
  "FloatField": "double precision",
115
115
  "IntegerField": "integer",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "plain.postgres"
3
- version = "0.89.0"
3
+ version = "0.89.1"
4
4
  description = "Model your data and store it in a database."
5
5
  authors = [{ name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev" }]
6
6
  readme = "README.md"
File without changes