-
Notifications
You must be signed in to change notification settings - Fork 14
Support length for various fields #176
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e3b85a6
Initial commit for custom length
f940b9c
Add new line
b5148b8
Address comments
2f124c1
Address comments
86f8dae
address more comments
810dfb2
Rebase
a2154ff
Add description
8cd95d6
support byte64
11db6cc
Adress comments and add tests in field_test.py
7b3b5a6
address comments
0196241
Address comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
spanner_orm/tests/migrations_for_emulator_test/create_custom_length_field_f959b767457d.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| """Spanner ORM migration: create_custom_length_field. | ||
|
|
||
| Migration ID: 'f959b767457d' | ||
| Created: 2022-09-13 13:28:34-07:00 | ||
| """ | ||
|
|
||
| import spanner_orm | ||
|
|
||
| migration_id = 'f959b767457d' | ||
| prev_migration_id = '69a8f072dacf' | ||
|
|
||
|
|
||
| class OriginalTeeTable(spanner_orm.model.Model): | ||
| """ORM Model with the original schema for the Commands table. | ||
| Don't update this model, create new migrations instead. | ||
| """ | ||
|
|
||
| __table__ = 'Tee' | ||
| id = spanner_orm.Field(spanner_orm.String, primary_key=True) | ||
| custom_string_length = spanner_orm.Field(spanner_orm.String(20)) | ||
| custom_array_string_length = spanner_orm.Field( | ||
| spanner_orm.Array(spanner_orm.String(4))) | ||
| custom_bytes_length = spanner_orm.Field(spanner_orm.BytesBase64(20)) | ||
| custom_array_bytes_length = spanner_orm.Field( | ||
| spanner_orm.Array(spanner_orm.BytesBase64(4))) | ||
|
|
||
|
|
||
| def upgrade() -> spanner_orm.CreateTable: | ||
|
dseomn marked this conversation as resolved.
|
||
| """Creates the original Commands table.""" | ||
| return spanner_orm.CreateTable(OriginalTeeTable) | ||
|
|
||
|
|
||
| def downgrade() -> spanner_orm.DropTable: | ||
| """Drops the original Commands table.""" | ||
| return spanner_orm.DropTable(OriginalTeeTable.__table__) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.