-
Notifications
You must be signed in to change notification settings - Fork 30
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
[DDL] Cleaning up primary key creation #1026
Conversation
@@ -112,3 +116,114 @@ func (d *DDLTestSuite) TestCreateTemporaryTable() { | |||
assert.Contains(d.T(), bqQuery, "CREATE TABLE IF NOT EXISTS `db`.`schema`.`tempTableName` (`foo` string,`bar` float64,`select` string) OPTIONS (expiration_timestamp =") | |||
} | |||
} | |||
|
|||
func (d *DDLTestSuite) Test_DropTemporaryTableCaseSensitive() { |
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.
No changes to these tests. I just moved them from ddl_test.go
@@ -1,123 +1,40 @@ | |||
package ddl_test | |||
package ddl |
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.
Note the pkg name change. I moved all the other tests out so that we can have this be ddl
. That way, we can have shouldCreatePrimaryKey
remain a private function.
Once this PR merges, I'm going to try to remove the need for us to specify a different package name.
lib/typing/columns/columns.go
Outdated
@@ -73,6 +72,11 @@ func (c *Column) ToLowerName() { | |||
c.name = strings.ToLower(c.name) | |||
} | |||
|
|||
// SetPrimaryKey is used for tests only. | |||
func (c *Column) SetPrimaryKey(primaryKey bool) { |
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.
Maybe we could name this SetPrimaryKeyForTest
so it's extra clear that we shouldn't use it outside of tests?
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.
sgtm
Standing up a function for determining whether we should be creating primary keys or not.