Skip to content

Commit

Permalink
Check for existing Roles table
Browse files Browse the repository at this point in the history
  • Loading branch information
little9 committed Sep 30, 2019
1 parent c273500 commit 06ac5e1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
18 changes: 10 additions & 8 deletions db/migrate/20190919145012_user_roles.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
class UserRoles < ActiveRecord::Migration[5.0]
def up
create_table :roles do |t|
t.string :name
unless table_exists?(:roles)
create_table :roles do |t|
t.string :name
end
create_table :roles_users, :id => false do |t|
t.references :role
t.references :user
end
add_index :roles_users, [:role_id, :user_id]
add_index :roles_users, [:user_id, :role_id]
end
create_table :roles_users, :id => false do |t|
t.references :role
t.references :user
end
add_index :roles_users, [:role_id, :user_id]
add_index :roles_users, [:user_id, :role_id]
end

def down
Expand Down
2 changes: 1 addition & 1 deletion lib/zizia/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Zizia
VERSION = '4.0.3.alpha.01'
VERSION = '4.1.0.alpha.01'
end
5 changes: 2 additions & 3 deletions zizia.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Gem::Specification.new do |gem|
gem.email = ['administrator@curationexperts.com']
gem.summary = 'Hyrax importers.'
gem.license = 'Apache-2.0'
gem.files = %w[README.md] +
Dir.glob('{app,config,db,lib}/**/*}')
gem.require_paths = ['.']
gem.files = `git ls-files`.split("\n")
gem.require_paths = ['lib']

gem.required_ruby_version = '>= 2.3.4'

Expand Down

0 comments on commit 06ac5e1

Please sign in to comment.