Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shotengai
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
shotengai
Commits
870dd2e9
Commit
870dd2e9
authored
Aug 31, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix migration to pass the rubocop
parent
04b35280
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
1_create_shotengai_products_and_orders.rb
db/migrate/1_create_shotengai_products_and_orders.rb
+15
-2
No files found.
db/migrate/1_create_shotengai_products_and_orders.rb
View file @
870dd2e9
class
CreateShotengaiProductsAndOrders
<
ActiveRecord
::
Migration
[
5.1
]
def
change
create_product
create_series
create_order
create_snapshot
end
def
create_product
create_table
:shotengai_products
do
|
t
|
t
.
string
:title
t
.
string
:status
...
...
@@ -18,11 +25,13 @@ class CreateShotengaiProductsAndOrders < ActiveRecord::Migration[5.1]
t
.
string
:manager_type
t
.
timestamps
end
end
add_index
:shotengai_products
,
[
:manager_id
,
:manager_type
]
add_index
:shotengai_products
,
:type
end
def
create_series
create_table
:shotengai_series
do
|
t
|
t
.
decimal
:original_price
,
precision:
9
,
scale:
2
t
.
decimal
:price
,
precision:
9
,
scale:
2
...
...
@@ -38,7 +47,9 @@ class CreateShotengaiProductsAndOrders < ActiveRecord::Migration[5.1]
end
add_index
:shotengai_series
,
:type
end
def
create_order
create_table
:shotengai_orders
do
|
t
|
t
.
integer
:seq
t
.
string
:address
...
...
@@ -62,7 +73,9 @@ class CreateShotengaiProductsAndOrders < ActiveRecord::Migration[5.1]
add_index
:shotengai_orders
,
:type
add_index
:shotengai_orders
,
[
:buyer_id
,
:buyer_type
]
end
def
create_snapshot
create_table
:shotengai_snapshots
do
|
t
|
t
.
decimal
:original_price
,
precision:
9
,
scale:
2
t
.
decimal
:price
,
precision:
9
,
scale:
2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment