-
Notifications
You must be signed in to change notification settings - Fork 0
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(filemanager): ingest constraints #136
Conversation
@@ -24,6 +24,9 @@ create table s3_object ( | |||
bucket text not null, | |||
-- The key of the object. | |||
key text not null, | |||
-- The version id of the object. A 'null' string is used to indicate no version id. This matches logic in AWS which | |||
-- also returns 'null' strings. | |||
version_id text not null default 'null', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this looks weird, but I think that it is okay because AWS specifies that when the version_id
is the string 'null'
, then versioning is not enabled: https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html. I.e. effectively, a version_id is always present, and AWS uses 'null'
when it's disabled.
There is an alternative, and that's to have another constraint that has nulls not distinct
on the version_id only, e.g. versioning_id_unique
, and then adding additional insert queries that target versioning_id_unique
for de-duplication. I feel that this adds more repetitive code, although I'm not sure which is the better approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First option LGTM, weird but it's documented... I'd probably add that docs url in the comment itself for reference.
@@ -24,6 +24,9 @@ create table s3_object ( | |||
bucket text not null, | |||
-- The key of the object. | |||
key text not null, | |||
-- The version id of the object. A 'null' string is used to indicate no version id. This matches logic in AWS which | |||
-- also returns 'null' strings. | |||
version_id text not null default 'null', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First option LGTM, weird but it's documented... I'd probably add that docs url in the comment itself for reference.
Closes #131
Changes
version_id
required with a default value as the 'null' string.current_objects
select query when reordering events.