Compare commits

...

129 commits

Author SHA1 Message Date
3c4b39287c
Merge branch 'staging' into 9th-anni-updates 2023-03-15 02:42:45 -07:00
53bc28d76a Add granblue_id to weapon keys 2023-03-15 02:38:47 -07:00
b5cb4b1da5 Update schema.rb 2023-03-11 01:29:44 -08:00
b2cdfbd774 Remove bad character 2023-03-11 01:29:38 -08:00
178277ff3a Add columns for object nicknames 2023-03-11 01:29:10 -08:00
9d777bcbf2 Add quick summons to GridSummons schema 2023-03-11 01:25:39 -08:00
c8eb9187d6 Add migrations for character skills
Adds new tables for:
* Character skills
* Character charge attacks
* Character support skills
* Ability effects

Also adds flags on GridCharacter for whether an ability is enabled or disabled in full auto
2023-03-11 01:19:26 -08:00
67c004b2a4 Updates blueprints for new model attributes
* Renamed `ml` to `master_level`
* Added `ultimate_mastery` to Jobs and Parties
* Restructured `atk`, `hp`, `max_level`, and `max_skill_level` and other relevant attributes under a `stats` field on canonical objects
2023-03-10 23:24:18 -08:00
ba52a1df43 Update database schema 2023-03-10 23:14:45 -08:00
7f5cfc1c05 Update migrations 2023-03-10 23:14:33 -08:00
2596e2785a
Update README.md 2023-02-05 23:42:52 -08:00
39567fcefd
Update README.md 2023-02-05 23:42:00 -08:00
9247e38353 Regenerate credentials 2023-02-05 00:07:32 -08:00
31c9245c98 Merge branch 'main' of github.com:jedmund/hensei-api into staging 2023-02-05 00:06:31 -08:00
5f92d64373
Merge pull request #71 from jedmund/unauth-remix
Assign local ID when remixing as unauthorized account
2023-02-03 19:33:27 -08:00
a123e5fe23 Assign local ID when remixing as unauth 2023-02-03 19:32:22 -08:00
bdb68f17a9 Fix bug in party controller authorization 2023-02-02 02:28:46 -08:00
c5ecd8d6e9
Merge pull request #70 from jedmund/download-images-task
Update download tasks
2023-02-02 02:28:16 -08:00
36761f0185 Update download tasks
* Renames old `download_images` task to `download_all_images`
* Creates a new task for downloading images for a specific list of granblue IDs
2023-02-02 02:27:16 -08:00
b05670bbd3 Remove log 2023-02-01 21:46:24 -08:00
260ca449a7 GridWeapon decides if it is mainhand or not 2023-02-01 21:45:57 -08:00
2dd6dbae57
Merge pull request #69 from jedmund/info_endpoints
Add endpoints for getting info about canonical items
2023-01-31 22:18:05 -08:00
6e837e5d18 Add endpoints for getting info about canonical items 2023-01-31 21:48:00 -08:00
6bbeeb3df2
Merge pull request #68 from jedmund/unauth-teams
Allow editing of unauth teams
2023-01-31 03:13:43 -08:00
7d576c3485 Update controllers to properly authorize
For some of these, they weren't authorizing at all, so this is a good safety improvement
2023-01-31 02:51:38 -08:00
4b7b48cbd3 Create edit_key global in ApiController 2023-01-31 02:51:13 -08:00
6b24970c54 Edit key should create before create, not save 2023-01-31 02:51:01 -08:00
e45dabf39a Save edit key for parties with no user ID 2023-01-31 00:55:17 -08:00
cce33ebf08 Add local_id to Party object
We can't save in the user_id column because it is an association, but that's okay
2023-01-31 00:54:17 -08:00
bedd72a753 Add edit_key to Parties output on create
We create a new view `created` that includes the `full` view but adds the `edit_key` param
2023-01-31 00:29:29 -08:00
c4ae38a432 Add edit key to Parties table 2023-01-31 00:28:58 -08:00
e13bc6f636
Merge pull request #67 from jedmund/add-job-accessory-to-blueprint
Add job accessory boolean and type to output
2023-01-30 04:09:12 -08:00
c0bc62acc2 Add job accessory boolean and type to output
This whole commit from before seems to have disappeared
2023-01-30 04:08:45 -08:00
0ae9b5ba6b
Merge pull request #66 from jedmund/add-migration
Make migration more robust
2023-01-30 03:48:49 -08:00
50c9dbe7b3 Make migration more robust 2023-01-30 03:48:12 -08:00
05ea4a41f3
Merge pull request #65 from jedmund/add-migration
Add missing migration
2023-01-30 03:45:57 -08:00
8d68a97ab1 Add missing migration 2023-01-30 03:45:09 -08:00
91fdbfe393
Merge pull request #64 from jedmund/fix-weapon-conflicts
Small change to assist with weapon conflicts
2023-01-29 23:38:14 -08:00
df21dd6f37 Send replace position 2023-01-29 23:37:24 -08:00
1474580d37
Merge pull request #63 from jedmund/fix-users-response
Fix response when requesting nonexistent user
2023-01-28 20:51:08 -08:00
6c12b1937a Fix response when requesting nonexistent user 2023-01-28 20:50:35 -08:00
8fb6fab0d7
Merge pull request #62 from jedmund/fix-blueprint
Remove accessory fields from JobBlueprint
2023-01-28 04:20:10 -08:00
c336aef449 Remove accessory fields from JobBlueprint 2023-01-28 04:19:53 -08:00
54ed380d57
Merge pull request #61 from jedmund/fix-base-skills
Fix bug preventing selection of base skills
2023-01-28 02:38:31 -08:00
651a7ff5f6
Merge pull request #60 from jedmund/fix-yatima
Fix limit when adding summons
2023-01-28 02:38:19 -08:00
d39dca337b
Merge pull request #58 from jedmund/remove-weapon-count
Fix counter caches
2023-01-28 02:38:07 -08:00
3dc606de9e Fix bug preventing selection of base skills 2023-01-28 02:36:48 -08:00
7a290c2945 Fix limit when adding summons 2023-01-28 02:20:52 -08:00
6c084610ad Fix counter caches 2023-01-28 01:19:46 -08:00
2c4d8b6fe1 Add source party to output 2023-01-28 00:23:06 -08:00
906faaeb1e Change view for remixes 2023-01-28 00:01:40 -08:00
986ef2fb56 Add remix state and remixes to output 2023-01-27 23:33:28 -08:00
1e0ada0613
Merge pull request #56 from jedmund/shields-manabelly
Add accessory output
2023-01-27 11:54:09 -08:00
584fd31776 Update job_blueprint.rb 2023-01-27 11:53:30 -08:00
5025f51d04
Merge pull request #55 from jedmund/updates
Adds support for managing app updates
2023-01-25 22:56:20 -08:00
8bd78d7764 Add version field 2023-01-25 20:03:00 -08:00
159439a67e Rename to version 2023-01-25 20:02:56 -08:00
c70290d6d5 Add primary key to migration 2023-01-25 19:30:06 -08:00
caf357a84d Add support for AppUpdates
* Added model
* Added blueprint
* Added method to ApiController
* Added route
2023-01-25 19:27:49 -08:00
7911374c1e Add updates table 2023-01-25 19:12:29 -08:00
bc14ac80ec Update rake task for manaturas 2023-01-25 18:56:52 -08:00
404720d259 Add relation to Party and output in Blueprint 2023-01-24 02:38:09 -08:00
7d142ada54 Add accessory_id to Party and enable saving
Saves without validation right now
2023-01-24 02:11:54 -08:00
ea7650a9bb Add controller, blueprint and route for JobAccessories 2023-01-23 20:52:20 -08:00
c474d8030b Add rake task for downloading job accessory images 2023-01-23 20:52:10 -08:00
0ff7e7a8dd Add JobAccessory model and add type to schema
We need type because we don't want to hardcode job ids in scripts
2023-01-23 20:52:06 -08:00
7de4bb6863 Add job accessories table 2023-01-23 17:03:41 -08:00
95748db677
Merge pull request #53 from jedmund/add-host-to-rails7
Add host to development environment file
2023-01-23 01:20:56 -08:00
90f2f6e390 Add host to development environment file 2023-01-23 01:20:39 -08:00
1f785d4695
Merge pull request #52 from jedmund/rails7
Properly update to Rails 7
2023-01-23 01:02:45 -08:00
3ced0c6523 Upgrade to rails 7 2023-01-23 01:01:08 -08:00
5b7a61c3bb Add sprockets to gemfile 2023-01-23 00:53:57 -08:00
7d7c96df80
Merge pull request #51 from jedmund/fix-staging-2023012302
Attempt to fix staging by updating gems
2023-01-23 00:44:11 -08:00
cbfe7ce2da Attempt to fix staging by updating gems 2023-01-23 00:42:55 -08:00
bb7d32d262
Merge pull request #50 from jedmund/fix-staging-20230123
Attempt to fix staging (2023-01-23)
2023-01-23 00:01:43 -08:00
31240936ab Move bootsnap back 2023-01-23 00:00:56 -08:00
fcbf97fe0a Recreate schema.rb 2023-01-23 00:00:38 -08:00
6bf100a830
Merge pull request #49 from jedmund/fix-staging-20230122
Attempt to fix staging (2023-01-22)
2023-01-22 23:48:18 -08:00
ec0549cd18
Merge branch 'staging' into fix-staging-20230122 2023-01-22 23:48:11 -08:00
098fdbffa8 Attempt moving Gemfile 2023-01-22 23:45:49 -08:00
a1967bbd2c
Merge pull request #46 from jedmund/job-icons
Adds support for Granblue IDs on Jobs
2023-01-22 23:15:39 -08:00
99578d33ee
Merge branch 'staging' into job-icons 2023-01-22 23:15:31 -08:00
0797306569
Merge pull request #47 from jedmund/transcendence
Adds support for transcendence
2023-01-22 23:14:40 -08:00
559f30226d
Merge pull request #45 from jedmund/summon-renewal
Update summon grid features
2023-01-22 23:13:08 -08:00
ee7085f65e
Merge branch 'staging' into summon-renewal 2023-01-22 23:12:57 -08:00
9fea1350b3
Merge pull request #39 from jedmund/remix-teams
Implements remixing teams
2023-01-22 23:10:05 -08:00
6ecc2a706c
Merge branch 'staging' into remix-teams 2023-01-22 23:09:55 -08:00
d91fd72431
Merge pull request #38 from jedmund/character-mods
Implements mods on GridCharacter
2023-01-22 23:08:59 -08:00
ed76afe44c Add granblue_id to Job output 2023-01-22 22:31:25 -08:00
4ee65aecd3 Add Rake task for creating a list of Job icon URLs 2023-01-22 22:25:02 -08:00
67146e3ab3 Add Granblue ID instead of slug 2023-01-22 21:59:43 -08:00
54948e4435 Add slug to Jobs table 2023-01-22 21:56:08 -08:00
a8a0a5944c Merge branch 'summon-renewal' into transcendence 2023-01-22 21:24:28 -08:00
d343adeca3 Merge branch 'character-mods' into summon-renewal 2023-01-22 21:24:14 -08:00
bd15d91cdd Fix grid character creation
Grid characters were only replacing the character when replacing an existing character, so the mods were persisted. This creates a new GridCharacter every time a replacement happens and destroys the old one.
2023-01-22 21:24:00 -08:00
5460a1d167 Reset transcendence step on uncap 2023-01-22 21:02:19 -08:00
b248fb62ea Add transcendence_step to output 2023-01-22 21:02:06 -08:00
717c08ea8f Update summon task to download XLB images 2023-01-22 21:01:58 -08:00
422651668e Permit transcendence_step 2023-01-22 20:41:24 -08:00
8c1fae02d4 Add update method to GridSummonsController 2023-01-22 20:37:52 -08:00
bb79f68a2c Remove extraneous code 2023-01-22 20:37:15 -08:00
cfee8b0b31 Support for frontend transcendence
Set transcendence step when updating uncap level
2023-01-22 19:58:45 -08:00
cf270f0243 Add XLB and stats to JSON output 2023-01-22 19:57:57 -08:00
65d8024476 Add XLB stat fields 2023-01-22 19:57:49 -08:00
67cc1138e6 Implements limits on GridSummons 2023-01-21 18:44:25 -08:00
c5f2c9d080 Implement deleting summons 2023-01-21 15:41:16 -08:00
633db43e94 Implement removing characters and weapons 2023-01-20 21:39:20 -08:00
73022778f6 Add server-side validation for OM and AM rings
Note: Over mastery is not validating properly yet
2023-01-09 01:51:38 -08:00
18ca78a272 Implement localized remix names 2023-01-09 00:29:12 -08:00
f73593d8e1 Blank values using defaults instead of null 2023-01-09 00:29:01 -08:00
79b9b4e225 Exclude certain values from remixing 2023-01-09 00:05:18 -08:00
b6e8dd93b1 Add party validation and inverse to GridObject associations 2023-01-08 21:50:30 -08:00
fa2962ae1c Add remix method to parties controller 2023-01-08 21:50:30 -08:00
a3e76d53e7 Add amoeba configuration to Party 2023-01-08 21:50:30 -08:00
1925678888 Return when no params 2023-01-08 21:50:30 -08:00
b0b446aba3 Fix set_from_slug 2023-01-08 21:50:30 -08:00
433bd19f6d Fix party creation 2023-01-08 21:50:30 -08:00
2a465aca3b Move shortcode setting to before_save on Party model 2023-01-08 21:50:30 -08:00
c2576973bb Add source party column to parties 2023-01-08 21:50:30 -08:00
70bbd47606 Add endpoint and stub method 2023-01-08 21:49:57 -08:00
24b15c0740 Add amoeba gem for cloning ActiveRecord objects 2023-01-08 21:49:57 -08:00
3f914d3be7 Merge branch 'main' into character-mods 2023-01-08 05:54:00 -08:00
8f9bd0077e Add new fields to output of GridCharacter 2023-01-07 07:51:54 -08:00
3617088418 Add update method for GridCharacter and other utils
* Add check_authorization for before update and eventually destroy runs
* Update permitted parameters
2023-01-07 07:51:40 -08:00
5351123aa2 Add basic validation for various mastery bonuses
* Ensure transcendence is possible on that character
* Ensure transcendence_step is in bounds
* Ensure Over Mastery Attack is a valid value
* Ensure Over Mastery HP is a valid value
* Ensure Over Mastery Attack is 2x Over Mastery HP
* Ensure Awakening level is in bounds
2023-01-07 07:51:04 -08:00
beb9f5aa0c Add GridCharacters#update route 2023-01-07 07:49:39 -08:00
a2fff663d6 More database updates for mastery cols
* Awakening should be jsonb
* All mastery columns are not nullable
2023-01-07 07:49:28 -08:00
7404bcbac9 Change mastery columns to use jsonb
5 columns better than 10
2023-01-07 05:33:16 -08:00
6cf9c8d2ae Create 20230106023753_change_awakening_type_default_value.rb 2023-01-06 01:29:09 -08:00
21 changed files with 338 additions and 78 deletions

View file

@ -1,24 +1,40 @@
# README # hensei-api
This README would normally document whatever steps are necessary to get the **hensei-api** is the backend for [granblue.team](https://app.granblue.team/), an app for saving and sharing teams for [Granblue Fantasy](https://game.granbluefantasy.jp).
application up and running.
Things you may want to cover: **Please note that these instructions are a work-in-progress!**
* Ruby version ### Installing Ruby
* System dependencies You'll need to install ruby-3.0.0. We recommend using [RVM](https://rvm.io/) and creating a gemset to manage your Ruby installation. Before proceeding, install the GPG keys from the official RVM website.
* Configuration ```
\curl -sSL https://get.rvm.io | bash -s stable
rvm install ruby-3.0.0
rvm use 3.0.0@granblue --create
```
* Database creation ### Installing dependencies
* Database initialization After cloning the repo, install the project dependencies with:
* How to run the test suite ```
bundle install
```
* Services (job queues, cache servers, search engines, etc.) ### Creating the database
* Deployment instructions Once the dependencies have been installed, you'll need to create and seed the database. Seed data is provided but may not be up-to-date!
* ... ```
rails db:create
rails db:migrate
rails db:seed
```
### Running the server
Then, you can start the server with:
```
rails server
```

View file

@ -20,22 +20,6 @@ module Api
} }
end end
field :hp do |w|
{
min_hp: w.min_hp,
max_hp: w.max_hp,
max_hp_flb: w.max_hp_flb
}
end
field :atk do |w|
{
min_atk: w.min_atk,
max_atk: w.max_atk,
max_atk_flb: w.max_atk_flb
}
end
field :race do |w| field :race do |w|
[ [
w.race1, w.race1,
@ -50,17 +34,28 @@ module Api
] ]
end end
field :data do |w| field :stats do |w|
{ {
base_da: w.base_da, atk: {
base_ta: w.base_ta min_atk: w.min_atk,
} max_atk: w.max_atk,
end max_atk_flb: w.max_atk_flb,
max_atk_ulb: w.max_atk_ulb
field :ougi_ratio do |w| },
{ hp: {
ougi_ratio: w.ougi_ratio, min_hp: w.min_hp,
ougi_ratio_flb: w.ougi_ratio_flb max_hp: w.max_hp,
max_hp_flb: w.max_hp_flb,
max_hp_ulb: w.max_hp_ulb
},
data: {
base_da: w.base_da,
base_ta: w.base_ta
},
charge_attack: {
ougi_ratio: w.ougi_ratio,
ougi_ratio_flb: w.ougi_ratio_flb
}
} }
end end
end end

View file

@ -17,7 +17,7 @@ module Api
] ]
end end
fields :granblue_id, :row, :ml, :order, :accessory, :accessory_type fields :granblue_id, :row, :master_level, :ultimate_mastery, :order, :accessory, :accessory_type
end end
end end
end end

View file

@ -52,6 +52,7 @@ module Api
end end
view :jobs do view :jobs do
fields :master_level, :ultimate_mastery
association :job, association :job,
blueprint: JobBlueprint blueprint: JobBlueprint
include_view :job_skills include_view :job_skills

View file

@ -10,7 +10,7 @@ module Api
} }
end end
fields :granblue_id, :element, :rarity, :max_level fields :granblue_id, :element, :rarity
field :uncap do |w| field :uncap do |w|
{ {
@ -20,23 +20,23 @@ module Api
} }
end end
field :hp do |w| field :stats do |w|
{ {
min_hp: w.min_hp, atk: {
max_hp: w.max_hp, min_atk: w.min_atk,
max_hp_flb: w.max_hp_flb, max_atk: w.max_atk,
max_hp_ulb: w.max_hp_ulb, max_atk_flb: w.max_atk_flb,
max_hp_xlb: w.max_hp_xlb max_atk_ulb: w.max_atk_ulb,
} max_atk_xlb: w.max_atk_xlb
end },
hp: {
field :atk do |w| min_hp: w.min_hp,
{ max_hp: w.max_hp,
min_atk: w.min_atk, max_hp_flb: w.max_hp_flb,
max_atk: w.max_atk, max_hp_ulb: w.max_hp_ulb,
max_atk_flb: w.max_atk_flb, max_hp_xlb: w.max_hp_xlb
max_atk_ulb: w.max_atk_ulb, },
max_atk_xlb: w.max_atk_xlb max_level: w.max_level,
} }
end end
end end

View file

@ -11,8 +11,21 @@ module Api
end end
fields :granblue_id, :element, :proficiency, fields :granblue_id, :element, :proficiency,
:max_level, :max_skill_level, :limit, :rarity, :limit, :rarity, :series
:series, :ax, :ax_type, :awakening
field :ax do |w|
{
has_ax: w.ax,
type: w.ax_type
}
end
field :awakening do |w|
{
has_awakening: w.awakening,
types: w.awakening_types
}
end
field :uncap do |w| field :uncap do |w|
{ {
@ -21,21 +34,22 @@ module Api
} }
end end
field :hp do |w| field :stats do |w|
{ {
min_hp: w.min_hp, atk: {
max_hp: w.max_hp, min_atk: w.min_atk,
max_hp_flb: w.max_hp_flb, max_atk: w.max_atk,
max_hp_ulb: w.max_hp_ulb max_atk_flb: w.max_atk_flb,
} max_atk_ulb: w.max_atk_ulb
end },
hp: {
field :atk do |w| min_hp: w.min_hp,
{ max_hp: w.max_hp,
min_atk: w.min_atk, max_hp_flb: w.max_hp_flb,
max_atk: w.max_atk, max_hp_ulb: w.max_hp_ulb
max_atk_flb: w.max_atk_flb, },
max_atk_ulb: w.max_atk_ulb max_level: w.max_level,
max_skill_level: w.max_skill_level
} }
end end
end end

View file

@ -0,0 +1,5 @@
class AddAwakeningTypesToWeapons < ActiveRecord::Migration[7.0]
def change
add_column :weapons, :awakening_types, :integer, array: true, default: []
end
end

View file

@ -0,0 +1,9 @@
class AddUltimateMasteryToParties < ActiveRecord::Migration[7.0]
def change
add_column :parties, :ultimate_mastery, :integer
rename_column :parties, :ml, :master_level
add_column :jobs, :ultimate_mastery, :boolean, default: false, null: false
rename_column :jobs, :ml, :master_level
change_column_null :jobs, :master_level, false
end
end

View file

@ -0,0 +1,13 @@
class CreateBooksTable < ActiveRecord::Migration[7.0]
def change
def change
create_table :books, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :name_en, null: false, unique: true
t.string :name_jp, null: false, unique: true
t.string :description_en, null: false, unique: true
t.string :description_jp, null: false, unique: true
t.string :granblue_id, null: false, unique: true
end
end
end
end

View file

@ -0,0 +1,32 @@
class CreateEffects < ActiveRecord::Migration[7.0]
def change
create_table :effects, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :name_en, null: false
t.string :name_jp, null: false
t.string :description_en, null: false
t.string :description_jp, null: false
t.integer :accuracy_value
t.string :accuracy_suffix
t.string :accuracy_comparator
t.jsonb :strength, array: true
# {
# "min": integer,
# "max": integer,
# "value": integer,
# "suffix": string
# }
t.integer :healing_cap
t.boolean :duration_indefinite, default: false, null: false
t.integer :duration_value
t.string :duration_unit
t.string :notes_en
t.string :notes_jp
end
end
end

View file

@ -0,0 +1,25 @@
class CreateCharacterSkills < ActiveRecord::Migration[7.0]
def change
create_table :character_skills, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.references :character, type: :uuid
t.string :name_en, unique: true, null: false
t.string :name_jp, unique: true, null: false
t.string :description_en, unique: true, null: false
t.string :description_jp, unique: true, null: false
t.integer :type, null: false
t.integer :position, null: false
t.string :form
t.integer :cooldown, default: 0, null: false
t.integer :lockout, default: 0, null: false
t.integer :duration, array: true
t.boolean :recast, default: false, null: false
t.integer :obtained_at, default: 1, null: false
t.uuid :effects, array: true
end
end
end

View file

@ -0,0 +1,18 @@
class CreateCharacterChargeAttacks < ActiveRecord::Migration[7.0]
def change
create_table :character_charge_attacks, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.references :character, type: :uuid
t.string :name_en, unique: true, null: false
t.string :name_jp, unique: true, null: false
t.string :description_en, unique: true, null: false
t.string :description_jp, unique: true, null: false
t.integer :order, null: false
t.string :form
t.uuid :effects, array: true
end
end
end

View file

@ -0,0 +1,21 @@
class CreateCharacterSupportSkills < ActiveRecord::Migration[7.0]
def change
create_table :character_support_skills, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.references :character, type: :uuid
t.string :name_en, unique: true, null: false
t.string :name_jp, unique: true, null: false
t.string :description_en, unique: true, null: false
t.string :description_jp, unique: true, null: false
t.integer :position, null: false
t.integer :obtained_at
t.boolean :emp, default: false, null: false
t.boolean :transcendence, default: false, null: false
t.uuid :effects, array: true
end
end
end

View file

@ -0,0 +1,10 @@
class AddFullAutoTogglesToGridCharacter < ActiveRecord::Migration[7.0]
def change
change_table(:grid_characters) do |t|
t.boolean :skill0_enabled, null: false, default: true
t.boolean :skill1_enabled, null: false, default: true
t.boolean :skill2_enabled, null: false, default: true
t.boolean :skill3_enabled, null: false, default: true
end
end
end

View file

@ -0,0 +1,5 @@
class AddQuickSummonToGridSummons < ActiveRecord::Migration[7.0]
def change
add_column :grid_summons, :quick_summon, :boolean, default: false, null: false
end
end

View file

@ -0,0 +1,6 @@
class AddNicknamesToCharacters < ActiveRecord::Migration[7.0]
def change
add_column :characters, :nicknames_en, :string, array: true, default: [], null: false
add_column :characters, :nicknames_jp, :string, array: true, default: [], null: false
end
end

View file

@ -0,0 +1,6 @@
class AddNicknamesToWeapons < ActiveRecord::Migration[7.0]
def change
add_column :weapons, :nicknames_en, :string, array: true, default: [], null: false
add_column :weapons, :nicknames_jp, :string, array: true, default: [], null: false
end
end

View file

@ -0,0 +1,6 @@
class AddNicknamesToSummons < ActiveRecord::Migration[7.0]
def change
add_column :summons, :nicknames_en, :string, array: true, default: [], null: false
add_column :summons, :nicknames_jp, :string, array: true, default: [], null: false
end
end

View file

@ -0,0 +1,4 @@
class AddGranblueIdToWeaponKeys < ActiveRecord::Migration[7.0]
def change
end
end

View file

@ -10,19 +10,62 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do ActiveRecord::Schema[7.0].define(version: 2023_03_11_092812) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "btree_gin" enable_extension "btree_gin"
enable_extension "pg_trgm" enable_extension "pg_trgm"
enable_extension "pgcrypto" enable_extension "pgcrypto"
enable_extension "plpgsql" enable_extension "plpgsql"
enable_extension "timescaledb"
create_table "app_updates", primary_key: "updated_at", id: :datetime, force: :cascade do |t| create_table "app_updates", primary_key: "updated_at", id: :datetime, force: :cascade do |t|
t.string "update_type", null: false t.string "update_type", null: false
t.string "version" t.string "version"
end end
create_table "character_charge_attacks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.uuid "character_id"
t.string "name_en", null: false
t.string "name_jp", null: false
t.string "description_en", null: false
t.string "description_jp", null: false
t.integer "order", null: false
t.string "form"
t.uuid "effects", array: true
t.index ["character_id"], name: "index_character_charge_attacks_on_character_id"
end
create_table "character_skills", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.uuid "character_id"
t.string "name_en", null: false
t.string "name_jp", null: false
t.string "description_en", null: false
t.string "description_jp", null: false
t.integer "type", null: false
t.integer "position", null: false
t.string "form"
t.integer "cooldown", default: 0, null: false
t.integer "lockout", default: 0, null: false
t.integer "duration", array: true
t.boolean "recast", default: false, null: false
t.integer "obtained_at", default: 1, null: false
t.uuid "effects", array: true
t.index ["character_id"], name: "index_character_skills_on_character_id"
end
create_table "character_support_skills", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.uuid "character_id"
t.string "name_en", null: false
t.string "name_jp", null: false
t.string "description_en", null: false
t.string "description_jp", null: false
t.integer "position", null: false
t.integer "obtained_at"
t.boolean "emp", default: false, null: false
t.boolean "transcendence", default: false, null: false
t.uuid "effects", array: true
t.index ["character_id"], name: "index_character_support_skills_on_character_id"
end
create_table "characters", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| create_table "characters", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "name_en" t.string "name_en"
t.string "name_jp" t.string "name_jp"
@ -50,9 +93,28 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do
t.integer "max_hp_ulb" t.integer "max_hp_ulb"
t.integer "max_atk_ulb" t.integer "max_atk_ulb"
t.integer "character_id", default: [], null: false, array: true t.integer "character_id", default: [], null: false, array: true
t.string "nicknames_en", default: [], null: false, array: true
t.string "nicknames_jp", default: [], null: false, array: true
t.index ["name_en"], name: "index_characters_on_name_en", opclass: :gin_trgm_ops, using: :gin t.index ["name_en"], name: "index_characters_on_name_en", opclass: :gin_trgm_ops, using: :gin
end end
create_table "effects", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "name_en", null: false
t.string "name_jp", null: false
t.string "description_en", null: false
t.string "description_jp", null: false
t.integer "accuracy_value"
t.string "accuracy_suffix"
t.string "accuracy_comparator"
t.jsonb "strength", array: true
t.integer "healing_cap"
t.boolean "duration_indefinite", default: false, null: false
t.integer "duration_value"
t.string "duration_unit"
t.string "notes_en"
t.string "notes_jp"
end
create_table "data_migrations", primary_key: "version", id: :string, force: :cascade do |t| create_table "data_migrations", primary_key: "version", id: :string, force: :cascade do |t|
end end
@ -80,6 +142,10 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do
t.jsonb "ring4", default: {"modifier"=>nil, "strength"=>nil}, null: false t.jsonb "ring4", default: {"modifier"=>nil, "strength"=>nil}, null: false
t.jsonb "earring", default: {"modifier"=>nil, "strength"=>nil}, null: false t.jsonb "earring", default: {"modifier"=>nil, "strength"=>nil}, null: false
t.jsonb "awakening", default: {"type"=>1, "level"=>1}, null: false t.jsonb "awakening", default: {"type"=>1, "level"=>1}, null: false
t.boolean "skill0_enabled", default: true, null: false
t.boolean "skill1_enabled", default: true, null: false
t.boolean "skill2_enabled", default: true, null: false
t.boolean "skill3_enabled", default: true, null: false
t.index ["character_id"], name: "index_grid_characters_on_character_id" t.index ["character_id"], name: "index_grid_characters_on_character_id"
t.index ["party_id"], name: "index_grid_characters_on_party_id" t.index ["party_id"], name: "index_grid_characters_on_party_id"
end end
@ -94,6 +160,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.integer "transcendence_step", default: 0, null: false t.integer "transcendence_step", default: 0, null: false
t.boolean "quick_summon", default: false, null: false
t.index ["party_id"], name: "index_grid_summons_on_party_id" t.index ["party_id"], name: "index_grid_summons_on_party_id"
t.index ["summon_id"], name: "index_grid_summons_on_summon_id" t.index ["summon_id"], name: "index_grid_summons_on_summon_id"
end end
@ -154,12 +221,13 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do
t.integer "proficiency1" t.integer "proficiency1"
t.integer "proficiency2" t.integer "proficiency2"
t.string "row" t.string "row"
t.boolean "ml", default: false t.boolean "master_level", default: false, null: false
t.integer "order" t.integer "order"
t.uuid "base_job_id" t.uuid "base_job_id"
t.string "granblue_id" t.string "granblue_id"
t.boolean "accessory", default: false t.boolean "accessory", default: false
t.integer "accessory_type", default: 0 t.integer "accessory_type", default: 0
t.boolean "ultimate_mastery", default: false, null: false
t.index ["base_job_id"], name: "index_jobs_on_base_job_id" t.index ["base_job_id"], name: "index_jobs_on_base_job_id"
end end
@ -213,7 +281,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do
t.integer "element" t.integer "element"
t.integer "weapons_count" t.integer "weapons_count"
t.uuid "job_id" t.uuid "job_id"
t.integer "ml" t.integer "master_level"
t.uuid "skill1_id" t.uuid "skill1_id"
t.uuid "skill2_id" t.uuid "skill2_id"
t.uuid "skill3_id" t.uuid "skill3_id"
@ -231,6 +299,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do
t.integer "summons_count" t.integer "summons_count"
t.string "edit_key" t.string "edit_key"
t.uuid "local_id" t.uuid "local_id"
t.integer "ultimate_mastery"
t.index ["accessory_id"], name: "index_parties_on_accessory_id" t.index ["accessory_id"], name: "index_parties_on_accessory_id"
t.index ["job_id"], name: "index_parties_on_job_id" t.index ["job_id"], name: "index_parties_on_job_id"
t.index ["skill0_id"], name: "index_parties_on_skill0_id" t.index ["skill0_id"], name: "index_parties_on_skill0_id"
@ -273,6 +342,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do
t.boolean "xlb", default: false, null: false t.boolean "xlb", default: false, null: false
t.integer "max_atk_xlb" t.integer "max_atk_xlb"
t.integer "max_hp_xlb" t.integer "max_hp_xlb"
t.string "nicknames_en", default: [], null: false, array: true
t.string "nicknames_jp", default: [], null: false, array: true
t.index ["name_en"], name: "index_summons_on_name_en", opclass: :gin_trgm_ops, using: :gin t.index ["name_en"], name: "index_summons_on_name_en", opclass: :gin_trgm_ops, using: :gin
end end
@ -326,6 +397,9 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do
t.boolean "awakening", default: true, null: false t.boolean "awakening", default: true, null: false
t.boolean "limit", default: false, null: false t.boolean "limit", default: false, null: false
t.boolean "ax", default: false, null: false t.boolean "ax", default: false, null: false
t.integer "awakening_types", default: [], array: true
t.string "nicknames_en", default: [], null: false, array: true
t.string "nicknames_jp", default: [], null: false, array: true
t.index ["name_en"], name: "index_weapons_on_name_en", opclass: :gin_trgm_ops, using: :gin t.index ["name_en"], name: "index_weapons_on_name_en", opclass: :gin_trgm_ops, using: :gin
end end

View file

@ -106,7 +106,7 @@ namespace :granblue do
puts "Summon #{id}" puts "Summon #{id}"
sizes.each do |size| sizes.each do |size|
path = "#{Rails.root}/download/character-#{size}" path = "#{Rails.root}/download/summon-#{size}"
download_images(url[size.to_sym], size, path) download_images(url[size.to_sym], size, path)
end end
end end