Skip to content

Conversation

@smklein
Copy link
Collaborator

@smklein smklein commented Oct 17, 2023

This PR does two things:

  1. It avoids checking for the order-dependent NOT NULL constraint in information schema, opting to parse the output of SHOW CONSTRAINTS and information_schema.columna.is_nullable instead.
  2. It re-orders the db_metadata creation to the end of dbinit.sql (mostly for clarity)

Fixes #4286

@gjcolombo
Copy link
Contributor

It re-orders the db_metadata creation to the end of dbinit.sql (mostly for clarity)

Hooray!

I've only skimmed the PR but will ask anyway: If this is now legal, is the guideline in the schema README to add new tables only to the end of dbinit.sql still relevant? (If it's not, we should remove it and consider replacing it with guidance that db_metadata should always be last.)

@smklein
Copy link
Collaborator Author

smklein commented Oct 17, 2023

It re-orders the db_metadata creation to the end of dbinit.sql (mostly for clarity)

Hooray!

I've only skimmed the PR but will ask anyway: If this is now legal, is the guideline in the schema README to add new tables only to the end of dbinit.sql still relevant? (If it's not, we should remove it and consider replacing it with guidance that db_metadata should always be last.)

Sure thing, I just pushed a small update to the schema/crdb README.

Copy link
Contributor

@david-crespo david-crespo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I confirmed this change makes the schema tests pass in #4261.

Copy link
Collaborator

@bnaecker bnaecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have enough context to really approve, but I don't see any issues!

@smklein smklein merged commit 463cc1a into main Oct 18, 2023
@smklein smklein deleted the dbinit-order branch October 18, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dbinit is getting too order dependent

5 participants