scinote-web/db/migrate/20210618104853_add_code_index_to_experiments.rb

8 lines
220 B
Ruby
Raw Normal View History

2021-06-18 20:19:35 +08:00
# frozen_string_literal: true
class AddCodeIndexToExperiments < ActiveRecord::Migration[6.1]
def change
2021-06-18 20:19:35 +08:00
add_index :experiments, "('EX' || id)", name: 'index_experiments_on_experiment_code', unique: true
end
end