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

Optionally disable data_schema.rb #182

Open
tmtrademarked opened this issue Apr 5, 2021 · 3 comments
Open

Optionally disable data_schema.rb #182

tmtrademarked opened this issue Apr 5, 2021 · 3 comments

Comments

@tmtrademarked
Copy link

In our project, we want to continue to dump the main db schema to our structure file (we happen to use structure.sql for it), but we don't particularly care to use the data_schema.rb file. With our current workflows, this file doesn't seem to provide a lot of value, and generates constant merge conflicts with our team which are a bit of a pain to resolve.

So two questions:

  1. Am I missing something fundamental about the value of this file? Maybe there's something I'm not seeing that means our workflows could or should change?
  2. Assuming we wanted to, would it be reasonable to add support for a configuration to optionally disable the creation of data_schema.rb? It seems like it would help teams with large numbers of contributors, but I'm not sure if such an option is philosophically aligned with this gem.
@adamzapasnik
Copy link

Hey @ilyakatz

This has come up a few times since I started using this gem. Would love to know your input as I haven't had time to really look into it and merge conflicts are quite annoying as we seem to do a lot of data migrations 😅

@ilyakatz
Copy link
Owner

Hey folks, it's been a long time since I've used this gem (i haven't been in rails land for a long time). I've tried to rejig my memory but really don't remember what the file is for (guess, should have documented it better). Could you provide an example of a file that it generates(if you're able to share without compromising your sensitive data), maybe that will trigger something.

@adamzapasnik
Copy link

sorry for a late response, it's a file generated by running data migrations, it'll just have a single line

DataMigrate::Data.define(version: 2023someversion)

regular migrations would generate schema.rb

it's a source of merge conflicts if there are data migrations on different branches. Same story as with regular migrations.

what has worked for me is simply adding the file to .gitignore as it's not used for anything in my setup (I don't run data migrations in test env, not sure if it'd make any difference if I did, though)

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

3 participants