Skip to content
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

Failed to generate migrations #10

Open
Z2Flow opened this issue Oct 10, 2023 · 3 comments
Open

Failed to generate migrations #10

Z2Flow opened this issue Oct 10, 2023 · 3 comments

Comments

@Z2Flow
Copy link

Z2Flow commented Oct 10, 2023

I have a schema generated by a visual modelling tool (DbSchema) and in generating migrations The Brick listed these errors:

Can't do devices because: premise_bt Can't do inspections because: inspector_bt, test_kit_bt, device_bt Can't do inspectors because: account_user_bt Can't do premises because: premise_manager_bt Can't do test_kits because: inspector_bt
DbSchema has a cyclic dependency checker and it came up empty—no errors.
I'm at a loss as to why The Brick failed these tables.
Are there conditions, other than cyclic dependencies, that cause failures?

@lorint
Copy link
Owner

lorint commented Oct 10, 2023

Are there conditions, other than cyclic dependencies, that cause failures?

There shouldn't be ... Often when this kind of thing surfaces, omitting just one table can cause the whole thing to complete, and then separately you can try adding a migration for that one table.

In this case you might want to first try omitting the top-listed entry -- premise_bt. Brick sequences the tables mentioned in the order of "connectedness", so it is most likely that those at the top are impacting things.

If that doesn't fly then second try omitting inspector_bt becuause that one is mentioned twice.

If you are OK to share the schema with me then I'd be curious to look through the structure and understand more. A set of DDL statements -- a bunch of CREATE TABLE -- is good, or just the schema.rb itself. Totally understand if this is not possible -- many systems out there are proprietary!

Thanks so much for reaching out, Rob -- curious to hear how this adventure progresses!

-Lorin

@Z2Flow
Copy link
Author

Z2Flow commented Oct 14, 2023 via email

@lorint
Copy link
Owner

lorint commented Oct 15, 2023

I’ve attached the schema ddl before the FK deletions, and also a diagram of the model.

Unfortunately it doesn't look like the "remailer" added any of the attachments -- feel free to send them directly to me at [email protected].

Fun to play with these kinds of things!

-Lorin

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

No branches or pull requests

2 participants