Code Monkey home page Code Monkey logo

actual_db_schema's Introduction

WideFix landing page

  • yarn
  • yarn dev and then open http://localhost:1234/
  • for production - yarn build and see dist folder

actual_db_schema's People

Contributors

ka8725 avatar ouyangjinting avatar pyromaniac 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

actual_db_schema's Issues

Implement dry run version of the script

Create a mechanism that allows to roll back the phantom migrations.

Ideas on how to implement it (can be implemented both):

  1. Add an option to the command line: rake db:rollback_branches --dry-run
  2. Via env var. Apply dry run if ACTUAL_DB_SCHEMA_ROLLBACK_BRANCHES_DRY_RUN=true

The dry run should not roll back any migrations but rather output the phantom migrations list.

Prefer the same output format in the output as in the following Rails' task:

rails db:migrate:status

 Status   Migration ID    Migration Name
--------------------------------------------------
   up     20220923211114  Initial
   up     20221003092332  Add typical clients and samples links to vendor applications
   up     20221003094301  Add vendor id index to messages
   up     20221004031502  Add vendor company to users
   up     20221115233057  Add status to vendor applications
   up     20221129184509  Add type to quotes
   up     20221207181413  Create admin user approvals
   up     20221223154500  Add templates for sale to vendor application
   up     20230105173250  Create categories
   up     20230113173555  Add data to projects
   up     20230120192110  Create services
   up     20230126045226  Add terms accepted at to users
   up     20230131174014  Add active to services

rollback migration cause data loss

As the title, it destroy data when happen migration rollback.
Can the data be automatically exported before rollback, and then imported back when migrating again?

PS: English is not my native language; please excuse typing errors.

Add unit tests

The tests should check:

  • When migration is up it "remembers" the run migrations inside the tmp folder.
  • If migration exists in tmp folder but if it's absent in migrations folder, it should be rolled back.
  • If migration is not reversible it should report the message.

Make rollback more informative

When the gem automatically rolls back, it's unclear why it was rolled back. Show some information in the output.

For example, this is a migration that was tried to be rolled back on running rails db:migrate:

== 20240208135613 AddNotNullConstraintToCategoryIdInProjects: migrating =======
-- change_column_null(:projects, :category_id, false)
   -> 0.0422s
== 20240208135613 AddNotNullConstraintToCategoryIdInProjects: migrated (0.0423s)

== 20240212121941 CreateQueSchema: reverting ==================================
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:

uninitialized constant CreateQueSchema::Que

    Que.migrate!(version: 0)
    ^^^
Did you mean?  Queue
~/tmp/migrated/20240212121941_create_que_schema.rb:11:in `down'

Caused by:
NameError: uninitialized constant CreateQueSchema::Que

    Que.migrate!(version: 0)
    ^^^
Did you mean?  Queue
~/tmp/migrated/20240212121941_create_que_schema.rb:11:in `down'
Tasks: TOP => db:_dump => db:rollback_branches
(See full trace by running task with --trace)

Note that it needs to be clarified why it was tried to roll it back. Add some info like: actual_db_schema rolls back this migration.

Also, it should not stop the migration on error raised, suppress it, show the error in the output, and move on.

wrong location name for phatom migrations in README

I am a user of this gem. I have spotted what I might call a typo in the README.

The README explains that the location for the phantom migrations is tmp/migrations. It's actually tmp/migrated.

I made the above observation while testing out the library. I was looking for tmp/migrations but I didn't find it. Turns out that it was tmp/migrated.

we can also see that in the implementations here:

I suppose it would be worthwhile to update the README to avoid confusion for other potential users.

Namespace rake tasks

Put the rake tasks into their own namespace to avoid possible collision with other gems.

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.