Add exercise types
This commit is contained in:
parent
7615febc5d
commit
500f5bd02e
|
@ -0,0 +1,5 @@
|
||||||
|
class ExerciseType < ApplicationRecord
|
||||||
|
validates :name,
|
||||||
|
:unit,
|
||||||
|
presence: true
|
||||||
|
end
|
|
@ -0,0 +1,10 @@
|
||||||
|
class CreateExerciseTypes < ActiveRecord::Migration[7.1]
|
||||||
|
def change
|
||||||
|
create_table :exercise_types do |t|
|
||||||
|
t.text :name, null: false
|
||||||
|
t.text :unit, null: false
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# 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.1].define(version: 2023_12_29_112620) do
|
ActiveRecord::Schema[7.1].define(version: 2023_12_29_112847) 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 "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
|
@ -63,6 +63,13 @@ ActiveRecord::Schema[7.1].define(version: 2023_12_29_112620) do
|
||||||
t.index ["user_id"], name: "index_blog_posts_on_user_id"
|
t.index ["user_id"], name: "index_blog_posts_on_user_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "exercise_types", force: :cascade do |t|
|
||||||
|
t.text "name", null: false
|
||||||
|
t.text "unit", null: false
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "foods", force: :cascade do |t|
|
create_table "foods", force: :cascade do |t|
|
||||||
t.text "name", null: false
|
t.text "name", null: false
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
running:
|
||||||
|
name: Running
|
||||||
|
unit: km
|
||||||
|
|
||||||
|
cycling:
|
||||||
|
name: Running
|
||||||
|
unit: km
|
Loading…
Reference in New Issue