Skip to content

Commit 26274cb

Browse files
committed
Adding new column at products
1 parent 83e8385 commit 26274cb

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
# api-pdv
2+
3+
Go to /pdv and run ```bundle install``` ```rails db:migrate``` ```rails db:seed``` ```rails s```

pdv/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Things you may want to cover:
2929
```rails g scaffold TYPE field1:integer field2:string```
3030
```rails db:migrate```
3131
```rails db:seed```
32+
```rails s```
3233

3334
user: viniarruda
3435
pass: a123
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddQuantityToProducts < ActiveRecord::Migration[5.2]
2+
def change
3+
add_column :products, :quantity, :integer
4+
end
5+
end

pdv/db/schema.rb

Lines changed: 2 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: 2019_02_22_135428) do
13+
ActiveRecord::Schema.define(version: 2019_03_13_124642) do
1414

1515
# These are extensions that must be enabled in order to support this database
1616
enable_extension "plpgsql"
@@ -26,6 +26,7 @@
2626
t.datetime "updated_at", null: false
2727
t.string "image"
2828
t.float "price"
29+
t.integer "quantity"
2930
end
3031

3132
create_table "users", force: :cascade do |t|

0 commit comments

Comments
 (0)