Ask A Question

Notifications

You’re not receiving notifications from this thread.

get data from once working db

sehrguey ogoltsoff asked in Databases

hi there,
quite a while ago I threw together a modest linguistic rails app demonstrating use of Russian 4-letter words in action based on ruby 2.3.3 which was deployed and worked online OK until the hosting company upgraded their platform to ruby 2.5.5 which broke dependencies and stopped the app.
So I copied the working app (2.3.3) to a repository on the GitHub deciding to look to it later. Then a bundle of concurrent circumstances brought about the aforementioned stretch of time to postpone the fulfilling of my decision and now I’ve run in a number of problems.
Firstly, my proficiency at RoR nosedived drastically. Secondly, the once-working-and-now-brought-back-to-life app shows blank tables which once upon a time had up to 200 rows.
My question is if it is possible to restore the data from the db folder containing:

[code]
bus@debian:~$ cd mat/maht/db && ls
development.sqlite3 migrate schema.rb seeds.rb
bus@debian:~/mat/maht/db$ ls migrate
20180529053331_create_w0words.rb 20180529053436_create_w2words.rb
20180529053421_create_w1words.rb
[/code]

and/or any other piece of the app a helper would consider needed.

Yours`
sehrguey

Reply

You can run rails db:migrate to run all the migrations in the db/migrate folder. That will make sure all your database tables are created. It won't restore any data, just the tables and columns though.

rails db:seed will populate the database with example records (assuming there is code to create records in db/seeds.rb. 👍

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,400+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.