Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix migrations for tables with arrays of BigInt #501

Merged
merged 1 commit into from
Apr 30, 2022

Conversation

dantownsend
Copy link
Member

@dantownsend dantownsend commented Apr 30, 2022

Fixes #500

If you had a table containing an array of BigInt, then migrations could fail:

from piccolo.table import Table
from piccolo.columns.column_types import Array, BigInt

class MyTable(Table):
    my_column = Array(base_column=BigInt())

It's because the BigInt base column needs access to the parent table to know if it's targeting Postgres or SQLite.

@dantownsend dantownsend added the bug Something isn't working label Apr 30, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 30, 2022

Codecov Report

Merging #501 (867cd30) into master (32bd3b1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #501   +/-   ##
=======================================
  Coverage   90.84%   90.84%           
=======================================
  Files         104      104           
  Lines        6998     7000    +2     
=======================================
+ Hits         6357     6359    +2     
  Misses        641      641           
Impacted Files Coverage Δ
piccolo/table.py 95.66% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32bd3b1...867cd30. Read the comment docs.

@dantownsend dantownsend merged commit 7f49ce6 into master Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValueError: _table isn't defined - the Table Metaclass should set it.
2 participants