mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 23:16:15 +08:00
the migration to update canvas coordinates
This commit is contained in:
parent
696075bf0f
commit
a6d39762db
12
db/migrate/20160809074757_update_my_module_coordinate.rb
Normal file
12
db/migrate/20160809074757_update_my_module_coordinate.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
class UpdateMyModuleCoordinate < ActiveRecord::Migration
|
||||
def change
|
||||
MyModule.all.each do |my_module|
|
||||
x = my_module.x
|
||||
y = my_module.y
|
||||
x = x * 32
|
||||
y = y * 16
|
||||
my_module.update(x: x)
|
||||
my_module.update(y: y)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20160704110900) do
|
||||
ActiveRecord::Schema.define(version: 20160809074757) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
|
Loading…
Reference in a new issue