-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from sanger/next_release
release-1.6.0
- Loading branch information
Showing
7 changed files
with
191 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
db/migrate/20160420084130_add_library_created_at_to_pac_bio_run.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class AddLibraryCreatedAtToPacBioRun < ActiveRecord::Migration | ||
def change | ||
change_table :pac_bio_run do |t| | ||
t.datetime :library_created_at, null: true, comment: 'Timestamp of library creation' | ||
end | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
db/migrate/20160621125538_add_phenotype_column_to_sample_table.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class AddPhenotypeColumnToSampleTable < ActiveRecord::Migration | ||
def change | ||
change_table :sample do |t| | ||
t.string 'phenotype', comment: 'The phenotype of the sample as described in Sequencescape' | ||
end | ||
end | ||
end |
73 changes: 73 additions & 0 deletions
73
db/migrate/20160810093024_unify_character_encoding_of_all_tables.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
class UnifyCharacterEncodingOfAllTables < ActiveRecord::Migration | ||
|
||
# SQL provided by David Harper | ||
|
||
def up | ||
psd_only = ENV['PSD_ONLY'] | ||
say "Updating PSD tables only" if psd_only | ||
|
||
say "Updating database defaults" | ||
ActiveRecord::Base.connection.execute("ALTER DATABASE CHARACTER SET = 'utf8' COLLATE = 'utf8_unicode_ci';") | ||
say "Updating flgen_plate" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `flgen_plate` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';") | ||
say "Updating iseq_flowcell" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `iseq_flowcell` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';") | ||
say "Updating pac_bio_run" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `pac_bio_run` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';") | ||
say "Updating sample" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `sample` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';") | ||
say "Updating schema_migrations" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `schema_migrations` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';") | ||
say "Updating study" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `study` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';") | ||
say "Updating study_users" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `study_users` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';") | ||
|
||
unless psd_only | ||
say "Updating non psd tables" | ||
say "Updating iseq_product_metrics",true | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `iseq_product_metrics` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';") | ||
say "Updating iseq_run_lane_metrics",true | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `iseq_run_lane_metrics` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';") | ||
say "Updating iseq_run_status",true | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `iseq_run_status` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';") | ||
say "Updating iseq_run_status_dict",true | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `iseq_run_status_dict` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';") | ||
end | ||
end | ||
|
||
def down | ||
psd_only = ENV['PSD_ONLY'] | ||
say "Restoring PSD tables only" if psd_only | ||
|
||
say "Restoring database defaults" | ||
ActiveRecord::Base.connection.execute("ALTER DATABASE CHARACTER SET = 'latin1' COLLATE = 'latin1_swedish_ci';") | ||
|
||
say "Restoring flgen_plate" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `flgen_plate` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';") | ||
say "Restoring iseq_flowcell" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `iseq_flowcell` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';") | ||
say "Restoring pac_bio_run" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `pac_bio_run` CONVERT TO CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';") | ||
say "Restoring sample" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `sample` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';") | ||
say "Restoring schema_migrations" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `schema_migrations` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';") | ||
say "Restoring study" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `study` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';") | ||
say "Restoring study_users" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `study_users` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';") | ||
|
||
unless psd_only | ||
say "Restoring non psd tables" | ||
say "Restoring iseq_product_metrics" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `iseq_product_metrics` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';") | ||
say "Restoring iseq_run_lane_metrics" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `iseq_run_lane_metrics` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';") | ||
say "Restoring iseq_run_status" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `iseq_run_status` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';") | ||
say "Restoring iseq_run_status_dict" | ||
ActiveRecord::Base.connection.execute("ALTER TABLE `iseq_run_status_dict` CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';") | ||
end | ||
end | ||
end |
Oops, something went wrong.