source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | test/cases/job_test.rb | Ruby | mit | 197 | main | 9,157 | require 'test_helper'
class JobTest < LambdakiqSpec
it '#active_job - a deserialize representation of what will be executed' do
e = event_basic messageId: message_id
aj = job(event: e).active_job
expect(aj).must_be_instance_of TestHelper::Jobs::BasicJob
expect(aj.job_id).must_equal '527cd37e-08f4-4a... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | test/cases/jobs/basic_job_test.rb | Ruby | mit | 197 | main | 1,201 | require 'test_helper'
class BasicJobTest < LambdakiqSpec
before do
TestHelper::Jobs::BasicJob.perform_later('somework')
expect(sent_message).must_be :present?
end
it 'message body' do
expect(sent_message_body['queue_name']).must_equal queue_name
expect(sent_message_body['job_class']).must_equal ... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | test/cases/jobs/basic_job_nofifo_job_test.rb | Ruby | mit | 197 | main | 569 | require 'test_helper'
class BasicJobNofifoTest < LambdakiqSpec
before do
TestHelper::Jobs::BasicNofifoJob.perform_later('somework')
expect(sent_message).must_be :present?
end
it 'message body has no fifo queue name vs fifo super class ' do
expect(sent_message_body['queue_name']).must_equal 'lambdaki... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | test/cases/jobs/basic_async_job_test.rb | Ruby | mit | 197 | main | 507 | require 'test_helper'
class BasicAsyncJobTest < LambdakiqSpec
before do
TestHelper::Jobs::BasicAsyncJob.perform_later('somework')
expect(sent_message).must_be :blank?
wait_for('Waiting for sent message API call.') { sent_message }
end
it 'message body' do
expect(sent_message_body['queue_name']).... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | test/cases/jobs/basic_job_nofifo_delay_test.rb | Ruby | mit | 197 | main | 574 | require 'test_helper'
class BasicJobNofifoDelayTest < LambdakiqSpec
before do
TestHelper::Jobs::BasicNofifoJob.set(wait: 5.minutes).perform_later('somework')
expect(sent_message).must_be :present?
end
it 'uses default `delay_seconds` since non-FIFO queues support this natively' do
expect(sent_messag... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | test/cases/jobs/basic_job_delay_test.rb | Ruby | mit | 197 | main | 509 | require 'test_helper'
class BasicJobDelayTest < LambdakiqSpec
before do
TestHelper::Jobs::BasicJob.set(wait: 5.minutes).perform_later('somework')
expect(sent_message).must_be :present?
end
it 'message attributes include `delay_seconds` since no wait was set' do
delay_seconds = sent_message_attribute... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | test/dummy_app/init.rb | Ruby | mit | 197 | main | 386 | require 'rails/all'
module Dummy
class Application < ::Rails::Application
config.root = File.join __FILE__, '..'
config.eager_load = true
logger = ActiveSupport::Logger.new(StringIO.new)
logger.formatter = ActiveSupport::Logger::SimpleFormatter.new
config.logger = logger
config.active_job.que... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq.rb | Ruby | mit | 197 | main | 792 | require 'json'
require 'digest'
require 'active_job'
require 'active_job/queue_adapters'
require 'active_support/all'
require 'lambdakiq/version'
require 'lambdakiq/error'
require 'lambdakiq/adapter'
require 'lambdakiq/client'
require 'lambdakiq/queue'
require 'lambdakiq/message'
require 'lambdakiq/event'
require 'lamb... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq/record.rb | Ruby | mit | 197 | main | 1,108 | module Lambdakiq
class Record
attr_reader :data
def initialize(data)
@data = data
end
def body
data['body']
end
def message_id
data['messageId']
end
def receipt_handle
data['receiptHandle']
end
def queue_name
@queue_name ||= data['eventSource... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq/railtie.rb | Ruby | mit | 197 | main | 583 | module Lambdakiq
class Railtie < ::Rails::Railtie
config.lambdakiq = ActiveSupport::OrderedOptions.new
config.lambdakiq.max_retries = 12
config.lambdakiq.metrics_namespace = 'Lambdakiq'
config.after_initialize do
config.active_job.logger = Rails.logger
config.lambdakiq.metrics_logger = Ra... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq/job.rb | Ruby | mit | 197 | main | 3,003 | module Lambdakiq
class Job
attr_reader :record, :error
class << self
def handler(event)
records = Event.records(event)
jobs = records.map { |record| new(record) }
jobs.each(&:perform)
failed_jobs = jobs.select { |j| j.error }
item_failures = failed_jobs.map { |... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq/adapter.rb | Ruby | mit | 197 | main | 999 | module ActiveJob
module QueueAdapters
class LambdakiqAdapter
def enqueue(job, options = {})
job.lambdakiq_async? ? _enqueue_async(job, options) : _enqueue(job, options)
end
def enqueue_at(job, timestamp)
enqueue job, delay_seconds: delay_seconds(timestamp)
end
def ... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq/client.rb | Ruby | mit | 197 | main | 638 | module Lambdakiq
class Client
class_attribute :default_options,
instance_writer: false,
instance_predicate: false
self.default_options = Hash.new
attr_reader :queues
def initialize
@queues = Hash.new do |h, name|
h[name] = Queue.new(name)
... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq/event.rb | Ruby | mit | 197 | main | 296 | module Lambdakiq
module Event
def jobs?(event)
records(event).any? { |r| job?(r) }
end
def job?(record)
record.dig('messageAttributes', 'lambdakiq', 'stringValue') == '1'
end
def records(event)
event['Records'] || []
end
extend self
end
end |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq/backoff.rb | Ruby | mit | 197 | main | 633 | module Lambdakiq
class Backoff
MAX_VISIBILITY_TIMEOUT = 43200 # 12 Hours
attr_reader :count
class << self
def backoff(count)
new(count).backoff
end
end
def initialize(count)
@count = count
end
# From Sidekiq: https://git.io/fhi5O
#
def backoff
... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq/queue.rb | Ruby | mit | 197 | main | 1,142 | module Lambdakiq
class Queue
attr_reader :queue_name,
:queue_url
def initialize(queue_name)
@queue_name = queue_name
@queue_url = get_queue_url
attributes
end
def send_message(job, options = {})
client.send_message send_message_params(job, options)
end
... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq/message.rb | Ruby | mit | 197 | main | 1,319 | module Lambdakiq
class Message
LAMBDAKIQ_ATTRIBUTE = { 'lambdakiq' => { string_value: '1', data_type: 'String' } }.freeze
attr_reader :queue, :job, :options
def initialize(queue, job, options = {})
@queue = queue
@job = job
@options = options
end
def params
message_param... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq/worker.rb | Ruby | mit | 197 | main | 570 | module Lambdakiq
module Worker
extend ActiveSupport::Concern
included do
class_attribute :lambdakiq_options_hash,
instance_predicate: false
self.lambdakiq_options_hash = Hash.new
end
class_methods do
def lambdakiq_options(options = {})
self.lambdakiq_... |
github | rails-lambda/lambdakiq | https://github.com/rails-lambda/lambdakiq | lib/lambdakiq/metrics.rb | Ruby | mit | 197 | main | 2,708 | module Lambdakiq
class Metrics
attr_reader :event
class << self
def log(event)
new(event).log
end
end
def initialize(event)
@event = event
@metrics = []
@properties = {}
instrument!
end
def log
return unless lambdakiq?
logger.info JSON... |
github | lzell/nickel | https://github.com/lzell/nickel | nickel.gemspec | Ruby | mit | 197 | master | 1,310 | Gem::Specification.new do |s|
s.name = "nickel"
s.version = "0.0.6"
s.summary = "Natural language date, time, and message parsing."
s.email = "lzell11@gmail.com"
s.homepage = "http://github.com/lzell/nickel"
s.description = "Extracts date, time, and message information from naturally worded text."
... |
github | lzell/nickel | https://github.com/lzell/nickel | Rakefile | Ruby | mit | 197 | master | 530 | require 'rake'
require 'rake/testtask'
require 'rdoc/task'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the nlp plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the nlp plugin.'
Rake::RDocTask.ne... |
github | lzell/nickel | https://github.com/lzell/nickel | spec/nickel_spec.rb | Ruby | mit | 197 | master | 3,876 | # Run with:
# ~/dev/nickel(master)$ rspec test/nickel_spec.rb
require File.expand_path(File.dirname(__FILE__) + "/../lib/nickel")
describe "A single date" do
before(:all) { @n = Nickel.parse "oct 15 09" }
it "should have an empty message" do
@n.message.should be_empty
end
it "should have a start ... |
github | lzell/nickel | https://github.com/lzell/nickel | test/nlp_test.rb | Ruby | mit | 197 | master | 46,448 | require 'test/unit'
path = File.expand_path(File.dirname(__FILE__))
require File.join(path, '..', 'lib', 'nickel.rb')
require File.join(path, 'nlp_tests_helper.rb')
include Nickel
# note that ZTime now has the '==' operator, so it won't go through Compare::Objects recursion, meaning we will miss @firm setting, but th... |
github | lzell/nickel | https://github.com/lzell/nickel | test/zdate_test.rb | Ruby | mit | 197 | master | 1,981 | require 'test/unit'
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'nickel', 'ruby_ext', 'to_s2.rb'))
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'nickel', 'zdate.rb'))
include Nickel
class ZDateTest < Test::Unit::TestCase
def test_get_next_date_from_date_of_mo... |
github | lzell/nickel | https://github.com/lzell/nickel | test/compare.rb | Ruby | mit | 197 | master | 3,237 | module Compare
# Use this to compare two objects, it will check their classes, instance vars, methods and instance var values
# to make sure the objects are "the same", they DO NOT have to share the same object_id, that's the point.
# NOTE: This won't work on any base classes (e.g. String, Fixnum, Array)
# I c... |
github | lzell/nickel | https://github.com/lzell/nickel | test/ztime_test.rb | Ruby | mit | 197 | master | 10,842 | require 'test/unit'
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'nickel', 'ruby_ext', 'to_s2.rb'))
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'nickel', 'ztime.rb'))
include Nickel
class ZTimeTest < Test::Unit::TestCase
def test_12_to_12am
t1 = ZTime.new... |
github | lzell/nickel | https://github.com/lzell/nickel | test/nlp_tests_helper.rb | Ruby | mit | 197 | master | 1,584 | require File.join(File.dirname(__FILE__), 'compare.rb')
require 'pp'
module NLPTestsHelper
# Removing pretty print and pretty_inspect dramatically improves test time.
PRETTY = false
def assert_nlp(nlpobj, occ_array)
nlp_occ_array = nlpobj.parse
inspect_method = PRETTY ? :pretty_inspect : :inspect
... |
github | lzell/nickel | https://github.com/lzell/nickel | lib/nickel.rb | Ruby | mit | 197 | master | 1,023 | # Ruby Nickel Library
# Copyright (c) 2008-2011 Lou Zell, lzell11@gmail.com, http://hazelmade.com
# MIT License [http://www.opensource.org/licenses/mit-license.php]
#
# Usage:
#
# Nickel.parse "some query", Time.local(2011, 7, 1)
#
# The second term is optional.
require 'logger'
require 'date'
path = File.expand_... |
github | lzell/nickel | https://github.com/lzell/nickel | lib/nickel/construct_interpreter.rb | Ruby | mit | 197 | master | 15,089 | # Ruby Nickel Library
# Copyright (c) 2008-2011 Lou Zell, lzell11@gmail.com, http://hazelmade.com
# MIT License [http://www.opensource.org/licenses/mit-license.php]
module Nickel
class ConstructInterpreter
attr_reader :occurrences, :constructs, :curdate
def initialize(constructs, curdate)
@construc... |
github | lzell/nickel | https://github.com/lzell/nickel | lib/nickel/construct_finder.rb | Ruby | mit | 197 | master | 60,302 | # Ruby Nickel Library
# Copyright (c) 2008-2011 Lou Zell, lzell11@gmail.com, http://hazelmade.com
# MIT License [http://www.opensource.org/licenses/mit-license.php]
module Nickel
class ConstructFinder
attr_reader :constructs, :components
def initialize(query, curdate, curtime)
# If query is a st... |
github | lzell/nickel | https://github.com/lzell/nickel | lib/nickel/construct.rb | Ruby | mit | 197 | master | 3,961 | # Ruby Nickel Library
# Copyright (c) 2008-2011 Lou Zell, lzell11@gmail.com, http://hazelmade.com
# MIT License [http://www.opensource.org/licenses/mit-license.php]
module Nickel
class Construct
include InstanceFromHash
attr_accessor :comp_start, :comp_end, :found_in
end
class DateConstruct < Construc... |
github | lzell/nickel | https://github.com/lzell/nickel | lib/nickel/nlp.rb | Ruby | mit | 197 | master | 2,942 | # Ruby Nickel Library
# Copyright (c) 2008-2011 Lou Zell, lzell11@gmail.com, http://hazelmade.com
# MIT License [http://www.opensource.org/licenses/mit-license.php]
module Nickel
class NLP
attr_reader :query, :input_date, :input_time, :nlp_query
attr_reader :construct_finder, :construct_interpreter
at... |
github | lzell/nickel | https://github.com/lzell/nickel | lib/nickel/occurrence.rb | Ruby | mit | 197 | master | 3,732 | # Ruby Nickel Library
# Copyright (c) 2008-2011 Lou Zell, lzell11@gmail.com, http://hazelmade.com
# MIT License [http://www.opensource.org/licenses/mit-license.php]
module Nickel
class Occurrence
include InstanceFromHash
# Some notes about this class, @type can take the following values:
# :single, :d... |
github | lzell/nickel | https://github.com/lzell/nickel | lib/nickel/instance_from_hash.rb | Ruby | mit | 197 | master | 302 | # Ruby Nickel Library
# Copyright (c) 2008-2011 Lou Zell, lzell11@gmail.com, http://hazelmade.com
# MIT License [http://www.opensource.org/licenses/mit-license.php]
module InstanceFromHash
def initialize(h)
h.each do |k,v|
instance_variable_set("@#{k}", v)
end
super()
end
end |
github | lzell/nickel | https://github.com/lzell/nickel | lib/nickel/query.rb | Ruby | mit | 197 | master | 72,298 | # Ruby Nickel Library
# Copyright (c) 2008-2011 Lou Zell, lzell11@gmail.com, http://hazelmade.com
# MIT License [http://www.opensource.org/licenses/mit-license.php]
module Nickel
class NLPQuery < String
include NLPQueryConstants
# Note there is no initialize here, it is inherited from string class.
... |
github | lzell/nickel | https://github.com/lzell/nickel | lib/nickel/query_constants.rb | Ruby | mit | 197 | master | 1,806 | # Ruby Nickel Library
# Copyright (c) 2008-2011 Lou Zell, lzell11@gmail.com, http://hazelmade.com
# MIT License [http://www.opensource.org/licenses/mit-license.php]
module Nickel
module NLPQueryConstants
DATE_DD = %r{\b((?:0?[1-9]|[12][0-9]|3[01])(?:st|nd|rd|th)?)\b}
DATE_DD_NB_ON_S... |
github | lzell/nickel | https://github.com/lzell/nickel | lib/nickel/ztime.rb | Ruby | mit | 197 | master | 10,352 | # Ruby Nickel Library
# Copyright (c) 2008-2011 Lou Zell, lzell11@gmail.com, http://hazelmade.com
# MIT License [http://www.opensource.org/licenses/mit-license.php]
module Nickel
class ZTime
# @firm will be used to indicate user provided am/pm
attr_accessor :firm
# @time is always stored on 24 hour ... |
github | lzell/nickel | https://github.com/lzell/nickel | lib/nickel/zdate.rb | Ruby | mit | 197 | master | 15,981 | # Ruby Nickel Library
# Copyright (c) 2008-2011 Lou Zell, lzell11@gmail.com, http://hazelmade.com
# MIT License [http://www.opensource.org/licenses/mit-license.php]
module Nickel
# TODO: get methods should accept dayname or dayindex
class ZDate
@days_of_week = ["mon","tue","wed","thu","fri","sat","sun"]
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | template.rb | Ruby | apache-2.0 | 197 | main | 479 | # frozen_string_literal: true
insert_into_file 'config/application.rb', after: /config\.load_defaults [0-9.]+$/ do
"\n config.add_autoload_paths_to_load_path = true"
end
# In order to test app generation with local code, un-comment the line below and comment out the other gem definition
# Then run hyrax generati... |
github | samvera/hyrax | https://github.com/samvera/hyrax | hyrax.gemspec | Ruby | apache-2.0 | 197 | main | 6,382 | # frozen_string_literal: true
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'hyrax/version'
Gem::Specification.new do |spec|
spec.authors = ["Justin Coyne", 'Michael J. Giarlo', "Carolyn Cole", "Matt Zumwalt", 'Jeremy Friesen', 'Trey Pendragon', 'Esm... |
github | samvera/hyrax | https://github.com/samvera/hyrax | Gemfile | Ruby | apache-2.0 | 197 | main | 591 | # frozen_string_literal: true
source 'https://rubygems.org'
# Please see hyrax.gemspec for dependency information.
# Install gems from test app
if ENV['RAILS_ROOT']
test_app_gemfile_path = File.expand_path('Gemfile', ENV['RAILS_ROOT'])
eval_gemfile test_app_gemfile_path
else
gemspec
end
group :development, :tes... |
github | samvera/hyrax | https://github.com/samvera/hyrax | Rakefile | Ruby | apache-2.0 | 197 | main | 284 | #!/usr/bin/env rake
# frozen_string_literal: true
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
Bundler::GemHelper.install_tasks
Dir.glob('tasks/*.rake').each { |r| import r }
task default: :ci |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/Gemfile | Ruby | apache-2.0 | 197 | main | 2,318 | # frozen_string_literal: true
# Attempts to determine if a global gem source has ready been added by another Gemfile
if @sources.global_rubygems_source == Bundler::SourceList.new.global_rubygems_source
Bundler.ui.info '[Koppie] Adding global rubygems source.'
source 'https://rubygems.org'
else
Bundler.ui.info "[K... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/seeds.rb | Ruby | apache-2.0 | 197 | main | 3,790 | wipe_data = ActiveModel::Type::Boolean.new.cast(ENV.fetch('WIPE_DATA', false))
seed_release_testing = ActiveModel::Type::Boolean.new.cast(ENV.fetch('SEED_RELEASE_TESTING', false))
seed_koppie = ActiveModel::Type::Boolean.new.cast(ENV.fetch('SEED_KOPPIE', false))
unless wipe_data || seed_release_testing
puts 'NAME'
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/schema.rb | Ruby | apache-2.0 | 197 | main | 32,497 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rai... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142466_add_work_counters_to_importer_runs.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 432 | # This migration comes from bulkrax (originally 20220119213325)
class AddWorkCountersToImporterRuns < ActiveRecord::Migration[5.1]
def change
add_column :bulkrax_importer_runs, :processed_works, :integer, default: 0 unless column_exists?(:bulkrax_importer_runs, :processed_works)
add_column :bulkrax_importer_r... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143534_create_single_use_links.hyrax.rb | Ruby | apache-2.0 | 197 | main | 261 | class CreateSingleUseLinks < ActiveRecord::Migration[5.2]
def change
create_table :single_use_links do |t|
t.string :downloadKey
t.string :path
t.string :itemId
t.datetime :expires
t.timestamps null: false
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142453_remove_foreign_key_from_bulkrax_entries.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 280 | # This migration comes from bulkrax (originally 20200312190638)
class RemoveForeignKeyFromBulkraxEntries < ActiveRecord::Migration[5.1]
def change
remove_foreign_key :bulkrax_entries, :bulkrax_importers if foreign_key_exists?(:bulkrax_entries, :bulkrax_importers)
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143432_add_polymorphic_type_to_bookmarks.blacklight.rb | Ruby | apache-2.0 | 197 | main | 410 | # frozen_string_literal: true
# This migration comes from blacklight (originally 20140320000000)
class AddPolymorphicTypeToBookmarks < ActiveRecord::Migration[4.2]
def change
add_column(:bookmarks, :document_type, :string) unless Bookmark.connection.column_exists? :bookmarks, :document_type
add_index :bo... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20240606205216_add_contexts_to_hyrax_flexible_schemas.rb | Ruby | apache-2.0 | 197 | main | 209 | class AddContextsToHyraxFlexibleSchemas < ActiveRecord::Migration[6.1]
def change
add_column :hyrax_flexible_schemas, :contexts, :text unless column_exists?(:hyrax_flexible_schemas, :contexts)
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142461_increase_text_sizes.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 762 | # This migration comes from bulkrax (originally 20210806065737)
class IncreaseTextSizes < ActiveRecord::Migration[5.1]
def change
change_column :bulkrax_entries, :raw_metadata, :text, limit: 16777215
change_column :bulkrax_entries, :parsed_metadata, :text, limit: 16777215
change_column :bulkrax_exporters,... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142443_change_collection_ids_on_entries.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 273 | # This migration comes from bulkrax (originally 20190715162044)
class ChangeCollectionIdsOnEntries < ActiveRecord::Migration[5.1]
def change
rename_column :bulkrax_entries, :collection_id, :collection_ids if column_exists?(:bulkrax_entries, :collection_id)
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143535_add_social_to_users.hyrax.rb | Ruby | apache-2.0 | 197 | main | 406 | class AddSocialToUsers < ActiveRecord::Migration[5.2]
def self.up
add_column :users, :facebook_handle, :string
add_column :users, :twitter_handle, :string
add_column :users, :googleplus_handle, :string
end
def self.down
remove_column :users, :facebook_handle, :string
remove_column :users, :tw... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142455_add_invalid_record_to_importer_run.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 281 | # This migration comes from bulkrax (originally 20200601204556)
class AddInvalidRecordToImporterRun < ActiveRecord::Migration[5.1]
def change
add_column :bulkrax_importer_runs, :invalid_records, :text unless column_exists?(:bulkrax_importer_runs, :invalid_records)
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142452_add_status_to_importers.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 555 | # This migration comes from bulkrax (originally 20200301232856)
class AddStatusToImporters < ActiveRecord::Migration[5.1]
def change
if table_exists?(:bulkrax_importers)
add_column :bulkrax_importers, :last_error, :text unless column_exists?(:bulkrax_importers, :last_error)
add_column :bulkrax_importe... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142463_rename_children_counters_to_relationships.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 473 | # This migration comes from bulkrax (originally 20211203195233)
class RenameChildrenCountersToRelationships < ActiveRecord::Migration[5.1]
def change
rename_column :bulkrax_importer_runs, :processed_children, :processed_relationships unless column_exists?(:bulkrax_importer_runs, :processed_relationships)
rena... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143532_create_version_committers.hyrax.rb | Ruby | apache-2.0 | 197 | main | 338 | class CreateVersionCommitters < ActiveRecord::Migration[5.2]
def self.up
create_table :version_committers do |t|
t.string :obj_id
t.string :datastream_id
t.string :version_id
t.string :committer_login
t.timestamps null: false
end
end
def self.down
drop_table :version_com... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143533_create_checksum_audit_logs.hyrax.rb | Ruby | apache-2.0 | 197 | main | 591 | class CreateChecksumAuditLogs < ActiveRecord::Migration[5.2]
def self.up
create_table :checksum_audit_logs do |t|
t.string :file_set_id
t.string :file_id
t.string :version
t.integer :pass
t.string :expected_result
t.string :actual_result
t.timestamps null: false
end
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142471_rename_bulkrax_importer_run_to_importer_run.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 850 | # This migration comes from bulkrax (originally 20220609001128)
class RenameBulkraxImporterRunToImporterRun < ActiveRecord::Migration[5.1]
def up
if column_exists?(:bulkrax_pending_relationships, :bulkrax_importer_run_id)
remove_foreign_key :bulkrax_pending_relationships, :bulkrax_importer_runs
remove... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142442_add_collections_to_importer_runs.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 455 | # This migration comes from bulkrax (originally 20190715161939)
class AddCollectionsToImporterRuns < ActiveRecord::Migration[5.1]
def change
add_column :bulkrax_importer_runs, :processed_collections, :integer, default: 0 unless column_exists?(:bulkrax_importer_runs, :processed_collections)
add_column :bulkrax... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143574_create_collection_branding_infos.hyrax.rb | Ruby | apache-2.0 | 197 | main | 346 | class CreateCollectionBrandingInfos < ActiveRecord::Migration[5.2]
def change
create_table :collection_branding_infos do |t|
t.string :collection_id
t.string :role
t.string :local_path
t.string :alt_text
t.string :target_url
t.integer :height
t.integer :width
t.tim... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143541_create_content_blocks.hyrax.rb | Ruby | apache-2.0 | 197 | main | 251 | class CreateContentBlocks < ActiveRecord::Migration[5.2]
def change
create_table :content_blocks do |t|
t.string :name
t.text :value
t.timestamps null: false
end
add_index :content_blocks, :name, unique: true
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142459_add_workflow_status_to_bulkrax_exporter.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 280 | # This migration comes from bulkrax (originally 20201117220007)
class AddWorkflowStatusToBulkraxExporter < ActiveRecord::Migration[5.1]
def change
add_column :bulkrax_exporters, :workflow_status, :string unless column_exists?(:bulkrax_exporters, :workflow_status)
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142480_entry_error_denormalization.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 485 | # This migration comes from bulkrax (originally 20241203010707)
class EntryErrorDenormalization < ActiveRecord::Migration[5.1]
def change
add_column :bulkrax_entries, :error_class, :string unless column_exists?(:bulkrax_entries, :error_class)
add_column :bulkrax_importers, :error_class, :string unless column_... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210921150126_create_updated_at_index.valkyrie_engine.rb | Ruby | apache-2.0 | 197 | main | 225 | # frozen_string_literal: true
# This migration comes from valkyrie_engine (originally 20180212092225)
class CreateUpdatedAtIndex < ActiveRecord::Migration[5.1]
def change
add_index :orm_resources, :updated_at
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142481_faster_first_entry.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 485 | # frozen_string_literal: true
# This migration comes from bulkrax (originally 20241205212513)
class FasterFirstEntry < ActiveRecord::Migration[5.2]
def change
add_index :bulkrax_entries, [:importerexporter_id, :importerexporter_type, :id], name: 'index_bulkrax_entries_on_importerexporter_id_type_and_id' unless in... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143602_create_qa_local_authority_entries.rb | Ruby | apache-2.0 | 197 | main | 373 | class CreateQaLocalAuthorityEntries < ActiveRecord::Migration[5.2]
def change
create_table :qa_local_authority_entries do |t|
t.references :local_authority, foreign_key: { to_table: :qa_local_authorities }, index: true
t.string :label
t.string :uri
t.timestamps
end
add_index :qa_l... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143573_update_collection_type_column_options.hyrax.rb | Ruby | apache-2.0 | 197 | main | 608 | class UpdateCollectionTypeColumnOptions < ActiveRecord::Migration[5.2]
def up
change_column :hyrax_collection_types, :title, :string, unique: true
change_column :hyrax_collection_types, :machine_id, :string, unique: true
remove_index :hyrax_collection_types, :machine_id
add_index :hyrax_collection_ty... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143538_create_trophies.hyrax.rb | Ruby | apache-2.0 | 197 | main | 206 | class CreateTrophies < ActiveRecord::Migration[5.2]
def change
create_table :trophies do |t|
t.integer :user_id
t.string :generic_file_id
t.timestamps null: false
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142457_move_to_statuses.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 765 | # This migration comes from bulkrax (originally 20200819054016)
class MoveToStatuses < ActiveRecord::Migration[5.1]
def change
Bulkrax::Importer.find_each do |i|
add_status(i)
end
Bulkrax::Exporter.find_each do |i|
add_status(i)
end
Bulkrax::Entry.find_each do |i|
add_status(i)... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143579_add_unique_constraint_to_permission_template_accesses.hyrax.rb | Ruby | apache-2.0 | 197 | main | 309 | class AddUniqueConstraintToPermissionTemplateAccesses < ActiveRecord::Migration[5.2]
def change
add_index :permission_template_accesses,
[:permission_template_id, :agent_id, :agent_type, :access],
unique: true,
name: 'uk_permission_template_accesses'
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142448_add_children_to_importer_runs.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 441 | # This migration comes from bulkrax (originally 20191204191623)
class AddChildrenToImporterRuns < ActiveRecord::Migration[5.1]
def change
add_column :bulkrax_importer_runs, :processed_children, :integer, default: 0 unless column_exists?(:bulkrax_importer_runs, :processed_children)
add_column :bulkrax_importer... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143556_create_uploaded_files.hyrax.rb | Ruby | apache-2.0 | 197 | main | 279 | class CreateUploadedFiles < ActiveRecord::Migration[5.2]
def change
create_table :uploaded_files do |t|
t.string :file
t.references :user, index: true, foreign_key: true
t.string :file_set_uri, index: true
t.timestamps null: false
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143559_change_featured_work_generic_file_id_to_work_id.hyrax.rb | Ruby | apache-2.0 | 197 | main | 230 | class ChangeFeaturedWorkGenericFileIdToWorkId < ActiveRecord::Migration[5.2]
def change
return unless column_exists?(:featured_works, :generic_file_id)
rename_column :featured_works, :generic_file_id, :work_id
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142469_add_include_thumbnails_to_bulkrax_exporters.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 307 | # This migration comes from bulkrax (originally 20220412233954)
class AddIncludeThumbnailsToBulkraxExporters < ActiveRecord::Migration[5.1]
def change
add_column :bulkrax_exporters, :include_thumbnails, :boolean, default: false unless column_exists?(:bulkrax_exporters, :include_thumbnails)
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143575_create_collection_type_participants.hyrax.rb | Ruby | apache-2.0 | 197 | main | 356 | class CreateCollectionTypeParticipants < ActiveRecord::Migration[5.2]
def change
create_table :collection_type_participants do |t|
t.references :hyrax_collection_type, foreign_key: true, index: {:name => "hyrax_collection_type_id"}
t.string :agent_type
t.string :agent_id
t.string :access
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143554_change_audit_log_generic_file_id_to_file_set_id.hyrax.rb | Ruby | apache-2.0 | 197 | main | 231 | class ChangeAuditLogGenericFileIdToFileSetId < ActiveRecord::Migration[5.2]
def change
rename_column :checksum_audit_logs, :generic_file_id, :file_set_id unless ChecksumAuditLog.column_names.include?('file_set_id')
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143570_create_job_io_wrappers.hyrax.rb | Ruby | apache-2.0 | 197 | main | 338 | class CreateJobIoWrappers < ActiveRecord::Migration[5.2]
def change
create_table :job_io_wrappers do |t|
t.references :user
t.references :uploaded_file
t.string :file_set_id
t.string :mime_type
t.string :original_name
t.string :path
t.string :relation
t.timestamps
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142467_create_bulkrax_pending_relationships.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 468 | # This migration comes from bulkrax (originally 20220301001839)
class CreateBulkraxPendingRelationships < ActiveRecord::Migration[5.1]
def change
unless table_exists?(:bulkrax_pending_relationships)
create_table :bulkrax_pending_relationships do |t|
t.belongs_to :bulkrax_importer_run, foreign_key: t... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143542_create_featured_works.hyrax.rb | Ruby | apache-2.0 | 197 | main | 297 | class CreateFeaturedWorks < ActiveRecord::Migration[5.2]
def change
create_table :featured_works do |t|
t.integer :order, default: 5
t.string :work_id
t.timestamps null: false
end
add_index :featured_works, :work_id
add_index :featured_works, :order
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143431_create_bookmarks.blacklight.rb | Ruby | apache-2.0 | 197 | main | 470 | # frozen_string_literal: true
# This migration comes from blacklight (originally 20140202020202)
class CreateBookmarks < ActiveRecord::Migration[4.2]
def self.up
create_table :bookmarks do |t|
t.integer :user_id, index: true, null: false
t.string :user_type
t.string :document_id, index: true
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142449_change_total_records_to_total_work_entries.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 433 | # This migration comes from bulkrax (originally 20191204223857)
class ChangeTotalRecordsToTotalWorkEntries < ActiveRecord::Migration[5.1]
def change
rename_column :bulkrax_importer_runs, :total_records, :total_work_entries if column_exists?(:bulkrax_importer_runs, :total_records)
rename_column :bulkrax_export... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142472_add_indices_to_bulkrax.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 1,348 | # This migration comes from bulkrax (originally 20230608153601)
# This migration comes from bulkrax (originally 20230608153601)
class AddIndicesToBulkrax < ActiveRecord::Migration[5.1]
def change
check_and_add_index :bulkrax_entries, :identifier
check_and_add_index :bulkrax_entries, :type
check_and_add_in... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143583_change_sipity_entity_specific_responsibility.hyrax.rb | Ruby | apache-2.0 | 197 | main | 384 | class ChangeSipityEntitySpecificResponsibility < ActiveRecord::Migration[5.2]
def change
if ActiveRecord::Base.connection.adapter_name == "PostgreSQL"
change_column :sipity_entity_specific_responsibilities, :entity_id, 'integer USING CAST(entity_id AS integer)'
else
change_column :sipity_entity_sp... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143537_add_avatars_to_users.hyrax.rb | Ruby | apache-2.0 | 197 | main | 505 | class AddAvatarsToUsers < ActiveRecord::Migration[5.2]
def self.up
add_column :users, "avatar_file_name", :string
add_column :users, "avatar_content_type", :string
add_column :users, "avatar_file_size", :integer
add_column :users, "avatar_updated_at", :datetime
end
def self.down
remov... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143564_create_permission_template_access.hyrax.rb | Ruby | apache-2.0 | 197 | main | 306 | class CreatePermissionTemplateAccess < ActiveRecord::Migration[5.2]
def change
create_table :permission_template_accesses do |t|
t.references :permission_template, foreign_key: true
t.string :agent_type
t.string :agent_id
t.string :access
t.timestamps
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143562_create_sipity_workflow_methods.hyrax.rb | Ruby | apache-2.0 | 197 | main | 401 | class CreateSipityWorkflowMethods < ActiveRecord::Migration[5.2]
def change
create_table :sipity_workflow_methods do |t|
t.string "service_name", null: false
t.integer "weight", null: false
t.integer "workflow_action_id", index: true, null: false
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142454_add_status_to_exporters.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 500 | # This migration comes from bulkrax (originally 20200326235838)
class AddStatusToExporters < ActiveRecord::Migration[5.1]
def change
add_column :bulkrax_exporters, :last_error, :text unless column_exists?(:bulkrax_exporters, :last_error)
add_column :bulkrax_exporters, :last_error_at, :datetime unless column_e... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210921150121_create_orm_resources.valkyrie_engine.rb | Ruby | apache-2.0 | 197 | main | 528 | # frozen_string_literal: true
# This migration comes from valkyrie_engine (originally 20161007101725)
class CreateOrmResources < ActiveRecord::Migration[5.0]
def options
if ENV["VALKYRIE_ID_TYPE"] == "string"
{ id: :text, default: -> { '(uuid_generate_v4())::text' } }
else
{ id: :uuid }
end
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210921150124_create_path_gin_index.valkyrie_engine.rb | Ruby | apache-2.0 | 197 | main | 250 | # frozen_string_literal: true
# This migration comes from valkyrie_engine (originally 20171011224121)
class CreatePathGinIndex < ActiveRecord::Migration[5.1]
def change
add_index :orm_resources, 'metadata jsonb_path_ops', using: :gin
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143572_update_collection_type_column_names.hyrax.rb | Ruby | apache-2.0 | 197 | main | 464 | class UpdateCollectionTypeColumnNames < ActiveRecord::Migration[5.2]
def change
rename_column :hyrax_collection_types, :discovery, :discoverable
rename_column :hyrax_collection_types, :sharing, :sharable
rename_column :hyrax_collection_types, :multiple_membership, :allow_multiple_membership
rename_col... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143565_add_release_to_permission_templates.hyrax.rb | Ruby | apache-2.0 | 197 | main | 214 | class AddReleaseToPermissionTemplates < ActiveRecord::Migration[5.2]
def change
add_column :permission_templates, :release_date, :date
add_column :permission_templates, :release_period, :string
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143551_add_works_to_user_stats.hyrax.rb | Ruby | apache-2.0 | 197 | main | 399 | class AddWorksToUserStats < ActiveRecord::Migration[5.2]
def self.up
add_column :user_stats, :work_views, :integer
add_column :work_view_stats, :user_id, :integer
add_index :work_view_stats, :user_id
end
def self.down
remove_column :user_stats, :work_views, :integer
remove_column :work_view_s... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142470_add_generated_metadata_to_bulkrax_exporters.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 307 | # This migration comes from bulkrax (originally 20220413180915)
class AddGeneratedMetadataToBulkraxExporters < ActiveRecord::Migration[5.1]
def change
add_column :bulkrax_exporters, :generated_metadata, :boolean, default: false unless column_exists?(:bulkrax_exporters, :generated_metadata)
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143549_create_user_stats.hyrax.rb | Ruby | apache-2.0 | 197 | main | 492 | class CreateUserStats < ActiveRecord::Migration[5.2]
def change
create_table :user_stats do |t|
t.integer :user_id
t.datetime :date
t.integer :file_views
t.integer :file_downloads
t.timestamps null: false
end
add_column :file_view_stats, :user_id, :integer
add_column :f... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143588_create_qa_local_authorities.rb | Ruby | apache-2.0 | 197 | main | 237 | class CreateQaLocalAuthorities < ActiveRecord::Migration[5.2]
def change
create_table :qa_local_authorities do |t|
t.string :name
t.timestamps
end
add_index :qa_local_authorities, :name, unique: true
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142451_add_validate_only_to_bulkrax_importers.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 276 | # This migration comes from bulkrax (originally 20200108194557)
class AddValidateOnlyToBulkraxImporters < ActiveRecord::Migration[5.1]
def change
add_column :bulkrax_importers, :validate_only, :boolean unless column_exists?(:bulkrax_importers, :validate_only)
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142456_create_bulkrax_statuses.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 531 | # This migration comes from bulkrax (originally 20200818055819)
class CreateBulkraxStatuses < ActiveRecord::Migration[5.1]
def change
unless table_exists?(:bulkrax_statuses)
create_table :bulkrax_statuses do |t|
t.string :status_message
t.string :error_class
t.string :error_message
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20250826142447_add_total_collection_records_to_importer_runs.bulkrax.rb | Ruby | apache-2.0 | 197 | main | 324 | # This migration comes from bulkrax (originally 20191203225129)
class AddTotalCollectionRecordsToImporterRuns < ActiveRecord::Migration[5.1]
def change
add_column :bulkrax_importer_runs, :total_collection_entries, :integer, default: 0 unless column_exists?(:bulkrax_importer_runs, :total_collection_entries)
end
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/db/migrate/20210911143536_add_ldap_attrs_to_user.hyrax.rb | Ruby | apache-2.0 | 197 | main | 891 | class AddLdapAttrsToUser < ActiveRecord::Migration[5.2]
def self.up
add_column :users, :display_name, :string
add_column :users, :address, :string
add_column :users, :admin_area, :string
add_column :users, :department, :string
add_column :users, :title, :string
add_column :users, :office, :str... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.