Skip to content
This repository was archived by the owner on Sep 24, 2019. It is now read-only.

Commit 9f7434d

Browse files
authored
Merge pull request #11 from GraphQLAcademy/add-vehicles
Add Vehicle model and fixtures
2 parents 370178a + 3ea313c commit 9f7434d

5 files changed

Lines changed: 589 additions & 1 deletion

File tree

app/models/vehicle.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Vehicle < ApplicationRecord
2+
end
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class CreateVehicles < ActiveRecord::Migration[5.0]
2+
def change
3+
create_table :vehicles do |t|
4+
t.string :name
5+
t.string :model
6+
t.string :vehicle_class
7+
t.string :manufacturer
8+
t.float :cost_in_credits
9+
t.float :length
10+
t.string :crew
11+
t.string :passengers
12+
t.integer :max_atmosphering_speed
13+
t.float :cargo_capacity
14+
t.string :consumables
15+
16+
t.timestamps
17+
end
18+
end
19+
end

db/schema.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema.define(version: 20170208210929) do
13+
ActiveRecord::Schema.define(version: 20170209014741) do
1414

1515
create_table "people", force: :cascade do |t|
1616
t.string "name"
@@ -66,4 +66,20 @@
6666
t.datetime "updated_at", null: false
6767
end
6868

69+
create_table "vehicles", force: :cascade do |t|
70+
t.string "name"
71+
t.string "model"
72+
t.string "vehicle_class"
73+
t.string "manufacturer"
74+
t.float "cost_in_credits"
75+
t.float "length"
76+
t.string "crew"
77+
t.string "passengers"
78+
t.integer "max_atmosphering_speed"
79+
t.float "cargo_capacity"
80+
t.string "consumables"
81+
t.datetime "created_at", null: false
82+
t.datetime "updated_at", null: false
83+
end
84+
6985
end

0 commit comments

Comments
 (0)