Commit 6c08a17
authored
Hotfix: Address missing constraint issue (#1007)
## Fixes issue
#1005
## Description of Changes
This fixes the issue we were having with trying to drop the
`faces_user_id_fkey` in the push to `main`. What happened was the
`faces_user_id_fkey` wasn't saved under a name in the previous database
model. PosgreSQL will drop any attached constraints when a column is
dropped (presuming there are no `CASCADE` effects), so I am removing the
`drop_constraint` commands and JUST dropping the column. This will allow
PostgreSQL to take care of the constraint problem for us.
## Tests and linting
- [x] This branch is up-to-date with the `develop` branch.
- [x] `pytest` passes on my local development environment.
- [x] `pre-commit` passes on my local development environment.
<details><summary>DB migration output</summary>
```console
:/usr/src/app$ flask db upgrade
[2023-08-03 21:48:37,989] INFO in __init__: OpenOversight startup
...
INFO [sqlalchemy.engine.Engine] COMMIT
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running upgrade 18f43ac4622f -> b38c133bed3c, add created_by and created_at columns
:/usr/src/app$ flask db downgrade
[2023-08-03 21:48:50,167] INFO in __init__: OpenOversight startup
...
INFO [sqlalchemy.engine.Engine] COMMIT
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running downgrade b38c133bed3c -> 18f43ac4622f, add created_by and created_at columns
:/usr/src/app$ flask db upgrade
[2023-08-03 21:48:58,053] INFO in __init__: OpenOversight startup
...
INFO [sqlalchemy.engine.Engine] COMMIT
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running upgrade 18f43ac4622f -> b38c133bed3c, add created_by and created_at columns
:/usr/src/app$
```
</details>1 parent cb63dfe commit 6c08a17
File tree
1 file changed
+0
-7
lines changed- OpenOversight/migrations/versions
1 file changed
+0
-7
lines changedLines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| |||
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
89 | | - | |
90 | 88 | | |
91 | 89 | | |
92 | 90 | | |
| |||
150 | 148 | | |
151 | 149 | | |
152 | 150 | | |
153 | | - | |
154 | | - | |
155 | 151 | | |
156 | 152 | | |
157 | 153 | | |
| |||
221 | 217 | | |
222 | 218 | | |
223 | 219 | | |
224 | | - | |
225 | 220 | | |
226 | 221 | | |
227 | 222 | | |
| |||
261 | 256 | | |
262 | 257 | | |
263 | 258 | | |
264 | | - | |
265 | 259 | | |
266 | 260 | | |
267 | 261 | | |
| |||
321 | 315 | | |
322 | 316 | | |
323 | 317 | | |
324 | | - | |
325 | 318 | | |
326 | 319 | | |
327 | 320 | | |
| |||
0 commit comments