Giter Club home page Giter Club logo

activerecord-clean-db-structure's People

Contributors

ajvondrak avatar dependabot[bot] avatar giovannibonetti avatar lfittl avatar nvanoorschot avatar palkan avatar ream88 avatar woodhull avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

activerecord-clean-db-structure's Issues

Merge conflicts on schema_migrations values

Hi, nice gem! The only thing we constantly run into is merge conflicts of branches when 2 people added new database migrations. At the bottom of the structure.sql there will be different versions which end with a semicolon.

The versions are currently listed as follows:

INSERT INTO "schema_migrations" (version) VALUES
('20190503120501'),
('20190506124902'),
('20190508123941'),
('20190508132644');

I think we can prevent a lot of merge conflicts if we uglify this a bit:

INSERT INTO "schema_migrations" (version) VALUES
 ('20190503120501')
,('20190506124902')
,('20190508123941')
,('20190508132644')
;

Let me know what you think. I can create a PR for this if you like.

Extensions are removed by default

Maybe you should add a property to allow removal or keeping the extensions? I faced the problem where it would be very useful. For instance:

config.activerecord_clean_db_structure.ignore_extensions = true

or

config.activerecord_clean_db_structure.remove_extensions = false

PG 10.x Foreign Key Constraints

Since moving to PG 10, FKs are not getting public. schema name cleaned up:

-ALTER TABLE ONLY dude_logs
-    ADD CONSTRAINT fk_rails_a1ad125ad2 FOREIGN KEY (dude_id) REFERENCES dudes(id);
+ALTER TABLE ONLY public.dude_logs
+    ADD CONSTRAINT fk_rails_a1ad125ad2 FOREIGN KEY (dude_id) REFERENCES public.dudes(id);

Another minor addition with search_path setting at top of file.

+SELECT pg_catalog.set_config('search_path', '', false);

I can certainly give a shot fixing this, but my regex-fu is admittedly a bit rusty, I might just cause us both more work!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.