From 3c567e0ba1b0b51b2183faedca028d354706c284 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 29 Jul 2023 11:58:24 -0700 Subject: [PATCH] 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. --- Vagrantfile | 5 +++++ db/schema.rb | 36 ++++++++++++++++++------------------ db/seeds.rb | 3 +++ 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 3d21643a..45636ea1 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -74,6 +74,11 @@ Vagrant.configure("2") do |config| apt-get update 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' + 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 'Then, run `bundle install`, and `rake db:schema:load && rake db:seed`!' SHELL end diff --git a/db/schema.rb b/db/schema.rb index 84e07238..c3cea44d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -171,9 +171,9 @@ ActiveRecord::Schema.define(version: 20230729181111) do add_index "login_cookies", ["user_id"], name: "login_cookies_user_id", using: :btree create_table "modeling_logs", force: true do |t| - t.timestamp "created_at", null: false - t.text "log_json", null: false - t.string "pet_name", limit: 128, null: false + t.datetime "created_at", null: false + t.text "log_json", null: false + t.string "pet_name", limit: 128, null: false end 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 create_table "swf_assets", force: true do |t| - t.string "type", limit: 7, null: false - t.integer "remote_id", limit: 3, null: false - t.text "url", limit: 16777215, null: false - t.integer "zone_id", limit: 1, null: false - t.text "zones_restrict", null: false - t.datetime "created_at", null: false - t.integer "body_id", limit: 2, null: false - t.boolean "has_image", default: false, null: false - t.boolean "image_requested", default: false, null: false - t.datetime "reported_broken_at" - t.datetime "converted_at" - t.boolean "image_manual", default: false, null: false - t.text "manifest", limit: 16777215 - t.timestamp "manifest_cached_at" - t.string "known_glitches", limit: 128, default: "" + t.string "type", limit: 7, null: false + t.integer "remote_id", limit: 3, null: false + t.text "url", limit: 16777215, null: false + t.integer "zone_id", limit: 1, null: false + t.text "zones_restrict", null: false + t.datetime "created_at", null: false + t.integer "body_id", limit: 2, null: false + t.boolean "has_image", default: false, null: false + t.boolean "image_requested", default: false, null: false + t.datetime "reported_broken_at" + t.datetime "converted_at" + t.boolean "image_manual", default: false, null: false + t.text "manifest", limit: 16777215 + t.datetime "manifest_cached_at" + t.string "known_glitches", limit: 128, default: "" end add_index "swf_assets", ["body_id"], name: "swf_assets_body_id_and_object_id", using: :btree diff --git a/db/seeds.rb b/db/seeds.rb index c49ebbac..f30ee996 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -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 => 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) + +User.create(name: "test", auth_server_id: -1, remote_id: -1) +Campaign.create(goal: 100_00, active: true, advertised: false, description: "")