-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only allow a single create-annotation per script
- Loading branch information
Showing
7 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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,2 @@ | ||
class MigratorException(Exception): | ||
pass |
This file contains 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,5 @@ | ||
from migrator.exceptions.MigratorException import MigratorException | ||
|
||
|
||
class MigratorScriptException(MigratorException): | ||
pass |
Empty file.
This file contains 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,47 @@ | ||
#!/usr/bin/python | ||
|
||
from migrator.dynamodb_migrator import Migrator | ||
from uuid import uuid4 | ||
|
||
|
||
migrator = Migrator() | ||
|
||
|
||
@migrator.version(1) | ||
@migrator.create( | ||
AttributeDefinitions=[{ | ||
'AttributeName': 'hash_key', | ||
'AttributeType': 'N' | ||
}], | ||
TableName=str(uuid4()), | ||
KeySchema=[{ | ||
'AttributeName': 'hash_key', | ||
'KeyType': 'HASH' | ||
}], | ||
BillingMode='PAY_PER_REQUEST') | ||
def create_table(created_table): | ||
# There are two create-statements in this file | ||
# There should always only be one | ||
# The table should never be created | ||
# And we should never get here | ||
assert False | ||
|
||
|
||
@migrator.version(1) | ||
@migrator.create( | ||
AttributeDefinitions=[{ | ||
'AttributeName': 'hash_key', | ||
'AttributeType': 'N' | ||
}], | ||
TableName=str(uuid4()), | ||
KeySchema=[{ | ||
'AttributeName': 'hash_key', | ||
'KeyType': 'HASH' | ||
}], | ||
BillingMode='PAY_PER_REQUEST') | ||
def create_another_table(created_table): | ||
# There are two create-statements in this file | ||
# There should always only be one | ||
# The table should never be created | ||
# And we should never get here | ||
assert False |
This file contains 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