Set up development database in Vagrant

Just a lil bit of extra provisioning and config! We also added some more to the `seeds.rb` task, to set up records that the app expects to exist.
This commit is contained in:
Matchu 2023-07-29 11:58:24 -07:00 committed by Matchu
parent 7edfda6d19
commit 5da4006053
3 changed files with 26 additions and 18 deletions

5
Vagrantfile vendored
View file

@ -74,6 +74,11 @@ Vagrant.configure("2") do |config|
apt-get update apt-get update
apt-get install -y rbenv libmysqlclient-dev libcurl4-openssl-dev nodejs apt-get install -y rbenv libmysqlclient-dev libcurl4-openssl-dev nodejs
su vagrant -c 'rbenv install 2.2.4 && gem install bundler -v 1.17.3' su vagrant -c 'rbenv install 2.2.4 && gem install bundler -v 1.17.3'
apt-get install -y mysql-server
mysql -e "CREATE USER IF NOT EXISTS openneo_impress IDENTIFIED BY 'openneo_impress';"
mysql -e "CREATE DATABASE IF NOT EXISTS openneo_impress;"
mysql -e "GRANT ALL PRIVILEGES ON openneo_impress.* TO openneo_impress;"
echo 'When you log in as vagrant, run `rbenv init` and follow the instructions!' echo 'When you log in as vagrant, run `rbenv init` and follow the instructions!'
echo 'Then, run `bundle install`, and `rake db:schema:load && rake db:seed`!'
SHELL SHELL
end end

View file

@ -171,9 +171,9 @@ ActiveRecord::Schema.define(version: 20230729181111) do
add_index "login_cookies", ["user_id"], name: "login_cookies_user_id", using: :btree add_index "login_cookies", ["user_id"], name: "login_cookies_user_id", using: :btree
create_table "modeling_logs", force: true do |t| create_table "modeling_logs", force: true do |t|
t.timestamp "created_at", null: false t.datetime "created_at", null: false
t.text "log_json", null: false t.text "log_json", null: false
t.string "pet_name", limit: 128, null: false t.string "pet_name", limit: 128, null: false
end end
create_table "neopets_connections", force: true do |t| create_table "neopets_connections", force: true do |t|
@ -265,21 +265,21 @@ ActiveRecord::Schema.define(version: 20230729181111) do
add_index "species_translations", ["species_id"], name: "index_species_translations_on_species_id", using: :btree add_index "species_translations", ["species_id"], name: "index_species_translations_on_species_id", using: :btree
create_table "swf_assets", force: true do |t| create_table "swf_assets", force: true do |t|
t.string "type", limit: 7, null: false t.string "type", limit: 7, null: false
t.integer "remote_id", limit: 3, null: false t.integer "remote_id", limit: 3, null: false
t.text "url", limit: 16777215, null: false t.text "url", limit: 16777215, null: false
t.integer "zone_id", limit: 1, null: false t.integer "zone_id", limit: 1, null: false
t.text "zones_restrict", null: false t.text "zones_restrict", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.integer "body_id", limit: 2, null: false t.integer "body_id", limit: 2, null: false
t.boolean "has_image", default: false, null: false t.boolean "has_image", default: false, null: false
t.boolean "image_requested", default: false, null: false t.boolean "image_requested", default: false, null: false
t.datetime "reported_broken_at" t.datetime "reported_broken_at"
t.datetime "converted_at" t.datetime "converted_at"
t.boolean "image_manual", default: false, null: false t.boolean "image_manual", default: false, null: false
t.text "manifest", limit: 16777215 t.text "manifest", limit: 16777215
t.timestamp "manifest_cached_at" t.datetime "manifest_cached_at"
t.string "known_glitches", limit: 128, default: "" t.string "known_glitches", limit: 128, default: ""
end end
add_index "swf_assets", ["body_id"], name: "swf_assets_body_id_and_object_id", using: :btree add_index "swf_assets", ["body_id"], name: "swf_assets_body_id_and_object_id", using: :btree

View file

@ -206,3 +206,6 @@ Zone.create(:id => 49, :label => "Right-hand Item", :plain_label => "righthand",
Zone.create(:id => 50, :label => "Hat", :plain_label => "hat", :depth => 16, :type_id => 2) Zone.create(:id => 50, :label => "Hat", :plain_label => "hat", :depth => 16, :type_id => 2)
Zone.create(:id => 51, :label => "Belt", :plain_label => "belt", :depth => 27, :type_id => 2) Zone.create(:id => 51, :label => "Belt", :plain_label => "belt", :depth => 27, :type_id => 2)
Zone.create(:id => 52, :label => "Foreground", :plain_label => "foreground", :depth => 52, :type_id => 3) Zone.create(:id => 52, :label => "Foreground", :plain_label => "foreground", :depth => 52, :type_id => 3)
User.create(name: "test", auth_server_id: -1, remote_id: -1)
Campaign.create(goal: 100_00, active: true, advertised: false, description: "")