mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-04 04:04:36 +08:00
Change primary key to bigint on repositories [SCI-2614][SCI-2616][SCI-2617]
This commit is contained in:
parent
6004f8411b
commit
938ec5acb8
6 changed files with 35 additions and 13 deletions
|
@ -3,7 +3,7 @@ AllCops:
|
||||||
- "vendor/**/*"
|
- "vendor/**/*"
|
||||||
- "db/schema.rb"
|
- "db/schema.rb"
|
||||||
UseCache: false
|
UseCache: false
|
||||||
TargetRubyVersion: 2.2
|
TargetRubyVersion: 2.4
|
||||||
|
|
||||||
##################### Style ####################################
|
##################### Style ####################################
|
||||||
|
|
||||||
|
|
1
Gemfile
1
Gemfile
|
@ -51,7 +51,6 @@ gem 'rgl' # Graph framework for project diagram calculations
|
||||||
gem 'nested_form_fields'
|
gem 'nested_form_fields'
|
||||||
gem 'ajax-datatables-rails', '~> 0.3.1'
|
gem 'ajax-datatables-rails', '~> 0.3.1'
|
||||||
gem 'commit_param_routing' # Enables different submit actions in the same form to route to different actions in controller
|
gem 'commit_param_routing' # Enables different submit actions in the same form to route to different actions in controller
|
||||||
gem 'kaminari'
|
|
||||||
gem 'i18n-js', '~> 3.0' # Localization in javascript files
|
gem 'i18n-js', '~> 3.0' # Localization in javascript files
|
||||||
gem 'roo', '~> 2.7.1' # Spreadsheet parser
|
gem 'roo', '~> 2.7.1' # Spreadsheet parser
|
||||||
gem 'wicked_pdf', '~> 1.1.0'
|
gem 'wicked_pdf', '~> 1.1.0'
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
class ChangePrimaryKeyToBigintOnRepositories < ActiveRecord::Migration[5.1]
|
||||||
|
def up
|
||||||
|
change_column :repository_rows, :id, :bigint
|
||||||
|
change_column :repository_columns, :id, :bigint
|
||||||
|
change_column :repository_cells, :id, :bigint
|
||||||
|
change_column :repository_cells, :repository_row_id, :bigint
|
||||||
|
change_column :repository_cells, :value_id, :bigint
|
||||||
|
change_column :repository_text_values, :id, :bigint
|
||||||
|
change_column :repository_date_values, :id, :bigint
|
||||||
|
change_column :my_module_repository_rows, :repository_row_id, :bigint
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
change_column :repository_rows, :id, :integer
|
||||||
|
change_column :repository_columns, :id, :integer
|
||||||
|
change_column :repository_cells, :id, :integer
|
||||||
|
change_column :repository_cells, :repository_row_id, :integer
|
||||||
|
change_column :repository_cells, :value_id, :integer
|
||||||
|
change_column :repository_text_values, :id, :integer
|
||||||
|
change_column :repository_date_values, :id, :integer
|
||||||
|
change_column :my_module_repository_rows, :repository_row_id, :integer
|
||||||
|
end
|
||||||
|
end
|
18
db/schema.rb
18
db/schema.rb
|
@ -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.define(version: 20180524091143) do
|
ActiveRecord::Schema.define(version: 20180806115201) 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"
|
||||||
|
@ -181,7 +181,7 @@ ActiveRecord::Schema.define(version: 20180524091143) do
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "my_module_repository_rows", id: :serial, force: :cascade do |t|
|
create_table "my_module_repository_rows", id: :serial, force: :cascade do |t|
|
||||||
t.integer "repository_row_id", null: false
|
t.bigint "repository_row_id", null: false
|
||||||
t.integer "my_module_id"
|
t.integer "my_module_id"
|
||||||
t.integer "assigned_by_id", null: false
|
t.integer "assigned_by_id", null: false
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
|
@ -379,11 +379,11 @@ ActiveRecord::Schema.define(version: 20180524091143) do
|
||||||
t.index ["last_modified_by_id"], name: "index_repository_asset_values_on_last_modified_by_id"
|
t.index ["last_modified_by_id"], name: "index_repository_asset_values_on_last_modified_by_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "repository_cells", id: :serial, force: :cascade do |t|
|
create_table "repository_cells", force: :cascade do |t|
|
||||||
t.integer "repository_row_id"
|
t.bigint "repository_row_id"
|
||||||
t.integer "repository_column_id"
|
t.integer "repository_column_id"
|
||||||
t.string "value_type"
|
t.string "value_type"
|
||||||
t.integer "value_id"
|
t.bigint "value_id"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.index ["repository_column_id"], name: "index_repository_cells_on_repository_column_id"
|
t.index ["repository_column_id"], name: "index_repository_cells_on_repository_column_id"
|
||||||
|
@ -391,7 +391,7 @@ ActiveRecord::Schema.define(version: 20180524091143) do
|
||||||
t.index ["value_type", "value_id"], name: "index_repository_cells_on_value_type_and_value_id"
|
t.index ["value_type", "value_id"], name: "index_repository_cells_on_value_type_and_value_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "repository_columns", id: :serial, force: :cascade do |t|
|
create_table "repository_columns", force: :cascade do |t|
|
||||||
t.integer "repository_id"
|
t.integer "repository_id"
|
||||||
t.integer "created_by_id", null: false
|
t.integer "created_by_id", null: false
|
||||||
t.string "name"
|
t.string "name"
|
||||||
|
@ -401,7 +401,7 @@ ActiveRecord::Schema.define(version: 20180524091143) do
|
||||||
t.index ["repository_id"], name: "index_repository_columns_on_repository_id"
|
t.index ["repository_id"], name: "index_repository_columns_on_repository_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "repository_date_values", id: :serial, force: :cascade do |t|
|
create_table "repository_date_values", force: :cascade do |t|
|
||||||
t.datetime "data"
|
t.datetime "data"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
@ -435,7 +435,7 @@ ActiveRecord::Schema.define(version: 20180524091143) do
|
||||||
t.index ["repository_list_item_id"], name: "index_repository_list_values_on_repository_list_item_id"
|
t.index ["repository_list_item_id"], name: "index_repository_list_values_on_repository_list_item_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "repository_rows", id: :serial, force: :cascade do |t|
|
create_table "repository_rows", force: :cascade do |t|
|
||||||
t.integer "repository_id"
|
t.integer "repository_id"
|
||||||
t.integer "created_by_id", null: false
|
t.integer "created_by_id", null: false
|
||||||
t.integer "last_modified_by_id", null: false
|
t.integer "last_modified_by_id", null: false
|
||||||
|
@ -456,7 +456,7 @@ ActiveRecord::Schema.define(version: 20180524091143) do
|
||||||
t.index ["user_id"], name: "index_repository_table_states_on_user_id"
|
t.index ["user_id"], name: "index_repository_table_states_on_user_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "repository_text_values", id: :serial, force: :cascade do |t|
|
create_table "repository_text_values", force: :cascade do |t|
|
||||||
t.string "data"
|
t.string "data"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
|
|
@ -2,7 +2,7 @@ version: '2'
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
container_name: scinote_db_production
|
container_name: scinote_db_production
|
||||||
image: postgres:9.4
|
image: postgres:9.6
|
||||||
volumes:
|
volumes:
|
||||||
- scinote_production_postgres:/var/lib/postgresql/data
|
- scinote_production_postgres:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ version: '2'
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
container_name: scinote_db_development
|
container_name: scinote_db_development
|
||||||
image: postgres:9.4
|
image: postgres:9.6
|
||||||
volumes:
|
volumes:
|
||||||
- scinote_development_postgres:/var/lib/postgresql/data
|
- scinote_development_postgres:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue