Skip to content

Filling the Database

Sven Gehring edited this page Oct 12, 2016 · 13 revisions

Get data into your development server

  1. Download our media database dump

  2. Import the dump to your database:

    gzcat anime.sql.gz | bin/psql hummingbird_development
    
  3. Set up Elasticsearch:

    bin/rake chewy:reset`
    

Starting with a blank database

Creating the database

Run the following to create the database and load structure.sql into it to get started:

$ bundle exec rake db:create db:structure:load

Gaining administrator access

Create an account with one of the staff emails. The confirmation email should be automatically opened in your default browser; if this fails, you can find it in tmp/letter_opener.

Filling the database

Go to /kotodama and enter id numbers from MyAnimeList into the "MAL Import" section to have them created automatically. Some of the ones with lots of characters and voice actors may time out: if this happens, you can use bundle exec rails console and run the following:

require 'mal_import'

Anime.create_or_update_from_hash MALImport.new(:anime, 123456).metadata

If you want to import Manga, replace all the "anime" with "manga" in that line.

Editing the database

Go to /kotodama/rails_admin. This will let you edit the database directly.

Clone this wiki locally