WideFix landing page
yarn
yarn dev
and thenopen http://localhost:1234/
- for production -
yarn build
and seedist
folder
Wipe out inconsistent DB and schema.rb when switching branches. Just install this gem and use the standard rake db:migrate command.
Home Page: https://blog.widefix.com/actual-db-schema/
License: MIT License
yarn
yarn dev
and then open http://localhost:1234/
yarn build
and see dist
folderI presume there can be a case when someone wants to run the rollback task manually. Introduce a config for that.
Create a mechanism that allows to roll back the phantom migrations.
Ideas on how to implement it (can be implemented both):
rake db:rollback_branches --dry-run
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
This is a very cool gem, but since my app has multiple databases, I can't use it.
It's explicitly disallowed here:
actual_db_schema/lib/tasks/db.rake
Line 80 in 0ff50ef
Though it might be some work, in principle this feels doable to me. I'm happy to make an attempt at a PR.
Add info that it can be disabled and used manually. Add necessary functionality if needed.
I want to be able to roll back specific phantom migrations manually one by one from any branch that has the applied phantom migrations.
Path
When saving the run migration in the temp folder, also remember the branch name (in a comment?).
Later, it can be used to show the status.
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.
The tests should check:
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.
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:
actual_db_schema/lib/actual_db_schema.rb
Line 31 in 3b5c4ad
I suppose it would be worthwhile to update the README to avoid confusion for other potential users.
Put the rake tasks into their own namespace to avoid possible collision with other gems.
Update readme with an explanation of how to use Gemfile.local
warning: csv was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add csv to your Gemfile or gemspec.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.