repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150119235023_add_flags_to_zip_tax_rate.rb | db/migrate/20150119235023_add_flags_to_zip_tax_rate.rb | # frozen_string_literal: true
class AddFlagsToZipTaxRate < ActiveRecord::Migration
def change
add_column :zip_tax_rates, :flags, :integer, default: 0, null: false
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111213214129_change_balance.rb | db/migrate/20111213214129_change_balance.rb | # frozen_string_literal: true
class ChangeBalance < ActiveRecord::Migration
def up
add_column :links, :balance_cents, :integer
Link.find_each do |link|
link.balance_cents = link.balance * 100
link.save(validation: false)
end
end
def down
remove_column :links, :balance_cents
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240126182800_add_reason_for_winning_to_dispute_evidences.rb | db/migrate/20240126182800_add_reason_for_winning_to_dispute_evidences.rb | # frozen_string_literal: true
class AddReasonForWinningToDisputeEvidences < ActiveRecord::Migration[7.0]
def change
add_column :dispute_evidences, :reason_for_winning, :text
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120615230235_add_preview_oembed_to_links.rb | db/migrate/20120615230235_add_preview_oembed_to_links.rb | # frozen_string_literal: true
class AddPreviewOembedToLinks < ActiveRecord::Migration
def change
add_column :links, :preview_oembed, :text
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210811155201_create_product_integration.rb | db/migrate/20210811155201_create_product_integration.rb | # frozen_string_literal: true
class CreateProductIntegration < ActiveRecord::Migration[6.1]
def change
create_table :product_integrations do |t|
t.bigint :product_id, null: false
t.bigint :integration_id, null: false
t.datetime :deleted_at
t.timestamps
end
add_index :product_integrations, :integration_id
add_index :product_integrations, :product_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240808230004_add_value_usd_cents_to_tips.rb | db/migrate/20240808230004_add_value_usd_cents_to_tips.rb | # frozen_string_literal: true
class AddValueUsdCentsToTips < ActiveRecord::Migration[7.1]
def change
add_column :tips, :value_usd_cents, :integer, null: false, default: 0
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121106231436_add_browser_guid_to_purchase.rb | db/migrate/20121106231436_add_browser_guid_to_purchase.rb | # frozen_string_literal: true
class AddBrowserGuidToPurchase < ActiveRecord::Migration
def up
add_column :purchases, :browser_guid, :string
add_index :purchases, :browser_guid
end
def down
remove_column :purchases, :browser_guid
remove_index :purchases, :browser_guid
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121019004516_add_index_to_users_external_id.rb | db/migrate/20121019004516_add_index_to_users_external_id.rb | # frozen_string_literal: true
class AddIndexToUsersExternalId < ActiveRecord::Migration
def up
add_index :users, :external_id
end
def down
remove_index :users, :external_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121009015308_remove_unique_permalink_from_purchases.rb | db/migrate/20121009015308_remove_unique_permalink_from_purchases.rb | # frozen_string_literal: true
class RemoveUniquePermalinkFromPurchases < ActiveRecord::Migration
def up
remove_column :purchases, :unique_permalink
end
def down
add_column :purchases, :unique_permalink, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140107031233_add_credit_card_zipcode_to_purchases.rb | db/migrate/20140107031233_add_credit_card_zipcode_to_purchases.rb | # frozen_string_literal: true
class AddCreditCardZipcodeToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :credit_card_zipcode, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111220181954_remove_floats.rb | db/migrate/20111220181954_remove_floats.rb | # frozen_string_literal: true
class RemoveFloats < ActiveRecord::Migration
def up
remove_column :links, :balance
remove_column :links, :price
remove_column :purchases, :price
add_column :users, :balance_cents, :integer, default: 0.0
User.find_each do |user|
user.balance_cents = user.balance * 100
user.save(validate: false)
end
change_column :links, :price_cents, :integer, default: 0
change_column :links, :balance_cents, :integer, default: 0
end
def down
add_column :links, :balance, :float, default: 0.0
add_column :links, :price, :float, default: 0.0
add_column :purchases, :price, :float, default: 0.0
remove_column :users, :balance_cents
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20200726140318_add_paypal_billing_agreement_id_to_credit_card.rb | db/migrate/20200726140318_add_paypal_billing_agreement_id_to_credit_card.rb | # frozen_string_literal: true
class AddPaypalBillingAgreementIdToCreditCard < ActiveRecord::Migration[6.0]
def up
add_column :credit_cards, :paypal_billing_agreement_id, :string
end
def down
remove_column :credit_cards, :paypal_billing_agreement_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230123055438_create_correlated_taxonomies.rb | db/migrate/20230123055438_create_correlated_taxonomies.rb | # frozen_string_literal: true
class CreateCorrelatedTaxonomies < ActiveRecord::Migration[7.0]
def change
create_table :correlated_taxonomies do |t|
t.references :taxonomy, index: { unique: true }, null: false
t.json :related_taxonomy_ids, null: false
t.timestamps
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120415223410_add_full_name_to_purchases.rb | db/migrate/20120415223410_add_full_name_to_purchases.rb | # frozen_string_literal: true
class AddFullNameToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :full_name, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20190318023359_add_admin_purchases_and_service_charges_search_index.rb | db/migrate/20190318023359_add_admin_purchases_and_service_charges_search_index.rb | # frozen_string_literal: true
class AddAdminPurchasesAndServiceChargesSearchIndex < ActiveRecord::Migration
def change
add_index :purchases, [:card_type, :card_visual, :stripe_fingerprint], name: "index_purchases_on_card_type_visual_fingerprint"
add_index :purchases, [:card_type, :card_visual, :created_at, :stripe_fingerprint], name: "index_purchases_on_card_type_visual_date_fingerprint"
add_index :service_charges, [:card_type, :card_visual, :charge_processor_fingerprint], name: "index_service_charges_on_card_type_visual_fingerprint"
add_index :service_charges, [:card_type, :card_visual, :created_at, :charge_processor_fingerprint], name: "index_service_charges_on_card_type_visual_date_fingerprint"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150520200001_add_merchant_id_to_credit.rb | db/migrate/20150520200001_add_merchant_id_to_credit.rb | # frozen_string_literal: true
class AddMerchantIdToCredit < ActiveRecord::Migration
def change
add_column :credits, :merchant_account_id, :integer, default: MerchantAccount.gumroad(StripeChargeProcessor.charge_processor_id).id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150211000000_create_user_underwriting.rb | db/migrate/20150211000000_create_user_underwriting.rb | # frozen_string_literal: true
class CreateUserUnderwriting < ActiveRecord::Migration
def change
create_table :user_underwriting, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.references :user
t.references :user_compliance_info
t.references :bank_account
t.integer :queued_by_admin_user_id
t.integer :approved_by_admin_user_id
t.string :from_relationship
t.string :to_relationship
t.string :underwriting_state
t.string :submission_group_id
t.timestamps
t.datetime :approved_at
t.datetime :submitted_at
t.datetime :acknowledged_at
t.datetime :negatively_acknowledged_at
t.datetime :merchant_accepted_at
t.datetime :merchant_rejected_at
end
add_index :user_underwriting, :user_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20141125013556_add_follower_user_id_to_follower.rb | db/migrate/20141125013556_add_follower_user_id_to_follower.rb | # frozen_string_literal: true
class AddFollowerUserIdToFollower < ActiveRecord::Migration
def change
add_column :followers, :follower_user_id, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120920210353_add_in_progress_to_purchases.rb | db/migrate/20120920210353_add_in_progress_to_purchases.rb | # frozen_string_literal: true
class AddInProgressToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :in_progress, :boolean, default: false
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220430143223_remove_default_from_affiliates_type.rb | db/migrate/20220430143223_remove_default_from_affiliates_type.rb | # frozen_string_literal: true
class RemoveDefaultFromAffiliatesType < ActiveRecord::Migration[6.1]
def change
change_column_default :affiliates, :type, from: "DirectAffiliate", to: nil
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120614000343_add_link_id_to_url_redirects.rb | db/migrate/20120614000343_add_link_id_to_url_redirects.rb | # frozen_string_literal: true
class AddLinkIdToUrlRedirects < ActiveRecord::Migration
def change
add_column :url_redirects, :link_id, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151219024411_create_email_info.rb | db/migrate/20151219024411_create_email_info.rb | # frozen_string_literal: true
class CreateEmailInfo < ActiveRecord::Migration
def change
create_table :email_infos, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci" do |t|
t.references :user
t.references :purchase
t.references :installment
t.string :type
t.string :email_name
t.string :state
t.datetime :sent_at
t.datetime :delivered_at
t.datetime :opened_at
end
add_index :email_infos, :user_id
add_index :email_infos, :purchase_id
add_index :email_infos, :installment_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220420191548_add_discover_fee_to_links.rb | db/migrate/20220420191548_add_discover_fee_to_links.rb | # frozen_string_literal: true
class AddDiscoverFeeToLinks < ActiveRecord::Migration[6.1]
def change
add_column :links, :discover_fee_per_thousand, :integer, default: 100
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20200512043527_add_subscriptions_deactivated_at.rb | db/migrate/20200512043527_add_subscriptions_deactivated_at.rb | # frozen_string_literal: true
class AddSubscriptionsDeactivatedAt < ActiveRecord::Migration
def up
add_column :subscriptions, :deactivated_at, :datetime
add_index :subscriptions, :deactivated_at
add_index :subscriptions, :ended_at
end
def down
remove_column :subscriptions, :deactivated_at
remove_index :subscriptions, :ended_at
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120330210442_create_credit_cards.rb | db/migrate/20120330210442_create_credit_cards.rb | # frozen_string_literal: true
class CreateCreditCards < ActiveRecord::Migration
def change
create_table :credit_cards do |t|
t.string :card_type
t.integer :expiry_month
t.integer :expiry_year
t.references :user
t.string :stripe_id
t.string :visual
t.timestamps
end
add_index :credit_cards, :user_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230926133822_drop_subscription_interruption_timestamps.rb | db/migrate/20230926133822_drop_subscription_interruption_timestamps.rb | # frozen_string_literal: true
class DropSubscriptionInterruptionTimestamps < ActiveRecord::Migration[7.0]
def up
change_table :subscriptions, bulk: true do |t|
t.remove :last_resubscribed_at
t.remove :last_deactivated_at
end
end
def down
change_table :subscriptions, bulk: true do |t|
t.datetime :last_resubscribed_at
t.datetime :last_deactivated_at
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121003035127_add_purchase_disabled_at_index_to_links.rb | db/migrate/20121003035127_add_purchase_disabled_at_index_to_links.rb | # frozen_string_literal: true
class AddPurchaseDisabledAtIndexToLinks < ActiveRecord::Migration
def change
add_index :links, :purchase_disabled_at
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210716062630_remove_unused_purchases_columns.rb | db/migrate/20210716062630_remove_unused_purchases_columns.rb | # frozen_string_literal: true
class RemoveUnusedPurchasesColumns < ActiveRecord::Migration[6.1]
def up
change_table :purchases, bulk: true do |t|
# Added
t.datetime :deleted_at
t.index [:purchase_state, :created_at]
# Changed
t.change :id, :bigint, null: false, unique: true, auto_increment: true
t.change :flags, :bigint, default: 0, null: false
t.change :seller_id, :bigint
t.change :link_id, :bigint
t.change :credit_card_id, :bigint
t.change :purchaser_id, :bigint
t.change :purchase_success_balance_id, :bigint
t.change :purchase_chargeback_balance_id, :bigint
t.change :purchase_refund_balance_id, :bigint
t.change :offer_code_id, :bigint
t.change :subscription_id, :bigint
t.change :preorder_id, :bigint
t.change :zip_tax_rate_id, :bigint
t.change :merchant_account_id, :bigint
t.change :affiliate_id, :bigint
t.change :price_id, :bigint
# Removed
t.remove :subunsub
t.remove :purchase_number
t.remove :in_progress
t.remove :billing_name
t.remove :billing_zip_code
t.remove :follow_up_count
t.remove :parent_id
t.remove_index :processor_payment_intent_id
t.remove_index :processor_setup_intent_id
t.remove_index [:seller_id, :purchase_state, :flags, :email]
end
end
def down
change_table :purchases, bulk: true do |t|
# Previously added
t.remove :deleted_at
t.remove_index [:purchase_state, :created_at]
# Previously changed
t.change :id, :integer, null: false, unique: true, auto_increment: true
t.change :flags, :integer, default: 0, null: false
t.change :seller_id, :integer
t.change :link_id, :integer
t.change :credit_card_id, :integer
t.change :purchaser_id, :integer
t.change :purchase_success_balance_id, :integer
t.change :purchase_chargeback_balance_id, :integer
t.change :purchase_refund_balance_id, :integer
t.change :offer_code_id, :integer
t.change :subscription_id, :integer
t.change :preorder_id, :integer
t.change :zip_tax_rate_id, :integer
t.change :merchant_account_id, :integer
t.change :affiliate_id, :integer
t.change :price_id, :integer
# Previously removed
t.string :subunsub
t.boolean :in_progress, default: false
t.integer :purchase_number
t.string :billing_name
t.string :billing_zip_code
t.integer :follow_up_count
t.integer :parent_id
t.index :processor_payment_intent_id
t.index :processor_setup_intent_id
t.index [:seller_id, :purchase_state, :flags, :email], name: :index_purchases_on_seller_id_and_state_and_flags_and_email, length: { email: 191 }
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231205052856_add_canada_tax_rates_to_purchase_taxjar_infos.rb | db/migrate/20231205052856_add_canada_tax_rates_to_purchase_taxjar_infos.rb | # frozen_string_literal: true
class AddCanadaTaxRatesToPurchaseTaxjarInfos < ActiveRecord::Migration[7.0]
def change
change_table :purchase_taxjar_infos, bulk: true do |t|
t.decimal :gst_tax_rate, precision: 8, scale: 7
t.decimal :pst_tax_rate, precision: 8, scale: 7
t.decimal :qst_tax_rate, precision: 8, scale: 7
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121211225739_add_index_to_custom_permalink_in_links.rb | db/migrate/20121211225739_add_index_to_custom_permalink_in_links.rb | # frozen_string_literal: true
class AddIndexToCustomPermalinkInLinks < ActiveRecord::Migration
def change
add_index :links, :custom_permalink
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111107215928_devise_create_users.rb | db/migrate/20111107215928_devise_create_users.rb | # frozen_string_literal: true
class DeviseCreateUsers < ActiveRecord::Migration
def self.up
create_table(:users) do |t|
# changed to upgrade devise. https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style
# database authenticatable
t.string(:email, default: "")
t.string(:encrypted_password, null: false, default: "")
# recoverable
t.string(:reset_password_token)
t.datetime(:reset_password_sent_at)
# rememberable
t.datetime(:remember_created_at)
# trackable
t.integer(:sign_in_count, default: 0)
t.datetime(:current_sign_in_at)
t.datetime(:last_sign_in_at)
t.string(:current_sign_in_ip)
t.string(:last_sign_in_ip)
t.timestamps
end
add_index :users, :email, unique: true
add_index :users, :reset_password_token, unique: true
# add_index :users, :confirmation_token, unique: true
# add_index :users, :unlock_token, unique: true
# add_index :users, :authentication_token, unique: true
end
def self.down
drop_table :users
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120710062458_add_stripe_status_to_purchases.rb | db/migrate/20120710062458_add_stripe_status_to_purchases.rb | # frozen_string_literal: true
class AddStripeStatusToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :stripe_status, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231119164304_drop_correlated_taxonomies.rb | db/migrate/20231119164304_drop_correlated_taxonomies.rb | # frozen_string_literal: true
class DropCorrelatedTaxonomies < ActiveRecord::Migration[7.0]
def up
drop_table :correlated_taxonomies
end
def down
create_table "correlated_taxonomies", charset: "utf8mb4", collation: "utf8mb4_unicode_ci" do |t|
t.bigint "taxonomy_id", null: false
t.json "related_taxonomy_ids", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["taxonomy_id"], name: "index_correlated_taxonomies_on_taxonomy_id", unique: true
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20200203195840_add_facebook_pixel_tracking_id_to_users.rb | db/migrate/20200203195840_add_facebook_pixel_tracking_id_to_users.rb | # frozen_string_literal: true
class AddFacebookPixelTrackingIdToUsers < ActiveRecord::Migration
def up
add_column :users, :facebook_pixel_id, :string
end
def down
remove_column :users, :facebook_pixel_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130612205213_change_follow_to_follower.rb | db/migrate/20130612205213_change_follow_to_follower.rb | # frozen_string_literal: true
class ChangeFollowToFollower < ActiveRecord::Migration
def up
rename_table :follows, :followers
end
def down
rename_table :followers, :follows
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220303123204_alter_email_infos_to_utf8mb4.rb | db/migrate/20220303123204_alter_email_infos_to_utf8mb4.rb | # frozen_string_literal: true
class AlterEmailInfosToUtf8mb4 < ActiveRecord::Migration[6.1]
def up
execute alter_query(charset: "utf8mb4", int_type: "bigint", varchar_limit: 255)
end
def down
execute alter_query(charset: "utf8", int_type: "int", varchar_limit: 191)
end
private
def alter_query(charset:, int_type:, varchar_limit:)
<<~SQL
ALTER TABLE email_infos
CHARACTER SET #{charset} COLLATE #{charset}_unicode_ci,
CHANGE `id` `id` #{int_type} NOT NULL AUTO_INCREMENT,
CHANGE `purchase_id` `purchase_id` #{int_type} DEFAULT NULL,
CHANGE `installment_id` `installment_id` #{int_type} DEFAULT NULL,
MODIFY `type` VARCHAR(#{varchar_limit}) CHARACTER SET #{charset} COLLATE #{charset}_unicode_ci DEFAULT NULL,
MODIFY `email_name` VARCHAR(#{varchar_limit}) CHARACTER SET #{charset} COLLATE #{charset}_unicode_ci DEFAULT NULL,
MODIFY `state` VARCHAR(#{varchar_limit}) CHARACTER SET #{charset} COLLATE #{charset}_unicode_ci DEFAULT NULL
SQL
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240626150102_create_commission_files.rb | db/migrate/20240626150102_create_commission_files.rb | # frozen_string_literal: true
class CreateCommissionFiles < ActiveRecord::Migration[7.1]
def change
create_table :commission_files do |t|
t.string :url, limit: 1024
t.references :commission, null: false
t.timestamps
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240430134831_add_followers_last_contacted_at_to_wishlists.rb | db/migrate/20240430134831_add_followers_last_contacted_at_to_wishlists.rb | # frozen_string_literal: true
class AddFollowersLastContactedAtToWishlists < ActiveRecord::Migration[7.1]
def change
add_column :wishlists, :followers_last_contacted_at, :datetime
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210725083553_change_media_location_ids_to_bigint.rb | db/migrate/20210725083553_change_media_location_ids_to_bigint.rb | # frozen_string_literal: true
class ChangeMediaLocationIdsToBigint < ActiveRecord::Migration[6.1]
def up
change_table :media_locations, bulk: true do |t|
t.change :id, :bigint, null: false, unique: true, auto_increment: true
t.change :product_file_id, :bigint
t.change :url_redirect_id, :bigint
t.change :purchase_id, :bigint
t.change :link_id, :bigint
end
end
def down
change_table :media_locations, bulk: true do |t|
t.change :id, :integer, null: false, unique: true, auto_increment: true
t.change :product_file_id, :integer
t.change :url_redirect_id, :integer
t.change :purchase_id, :integer
t.change :link_id, :integer
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230720171507_change_shipped_at_to_datetime_on_dispute_evidences.rb | db/migrate/20230720171507_change_shipped_at_to_datetime_on_dispute_evidences.rb | # frozen_string_literal: true
class ChangeShippedAtToDatetimeOnDisputeEvidences < ActiveRecord::Migration[7.0]
def up
execute "UPDATE `dispute_evidences` SET `dispute_evidences`.`shipped_at` = NULL;"
change_column :dispute_evidences, :shipped_at, :datetime
end
def down
change_column :dispute_evidences, :shipped_at, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231017001012_add_resolution_fields_to_dispute_evidences.rb | db/migrate/20231017001012_add_resolution_fields_to_dispute_evidences.rb | # frozen_string_literal: true
class AddResolutionFieldsToDisputeEvidences < ActiveRecord::Migration[7.0]
def change
change_table :dispute_evidences, bulk: true do |t|
t.datetime :resolved_at
t.string :resolution, default: "unknown"
t.string :error_message
t.index :resolved_at
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150601000000_add_stripe_bank_account_id_to_bank_accounts.rb | db/migrate/20150601000000_add_stripe_bank_account_id_to_bank_accounts.rb | # frozen_string_literal: true
class AddStripeBankAccountIdToBankAccounts < ActiveRecord::Migration
def change
add_column :bank_accounts, :stripe_bank_account_id, :string
add_column :bank_accounts, :stripe_fingerprint, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140917180234_create_audit_tasks.rb | db/migrate/20140917180234_create_audit_tasks.rb | # frozen_string_literal: true
class CreateAuditTasks < ActiveRecord::Migration
def change
create_table :audit_tasks do |t|
t.string :name
t.references :owner
t.date :due_date
t.string :status
t.integer :recurrence_days
t.timestamps
end
add_index :audit_tasks, :owner_id
add_index :audit_tasks, :due_date
add_index :audit_tasks, :status
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121115192157_add_risk_score_updated_at_to_links.rb | db/migrate/20121115192157_add_risk_score_updated_at_to_links.rb | # frozen_string_literal: true
class AddRiskScoreUpdatedAtToLinks < ActiveRecord::Migration
def change
add_column :links, :risk_score_updated_at, :datetime
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121221190001_add_payout_period_end_date_to_payments.rb | db/migrate/20121221190001_add_payout_period_end_date_to_payments.rb | # frozen_string_literal: true
class AddPayoutPeriodEndDateToPayments < ActiveRecord::Migration
def change
add_column :payments, :payout_period_end_date, :date
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130930181714_add_timestamps_to_followers.rb | db/migrate/20130930181714_add_timestamps_to_followers.rb | # frozen_string_literal: true
class AddTimestampsToFollowers < ActiveRecord::Migration
def change
change_table :followers do |t|
t.timestamps
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20141208215925_drop_compliance_entities.rb | db/migrate/20141208215925_drop_compliance_entities.rb | # frozen_string_literal: true
class DropComplianceEntities < ActiveRecord::Migration
def change
drop_table :compliance_entities
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140910202429_add_support_email_to_users.rb | db/migrate/20140910202429_add_support_email_to_users.rb | # frozen_string_literal: true
class AddSupportEmailToUsers < ActiveRecord::Migration
def change
add_column :users, :support_email, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20200513124526_fix_json_data_in_user_compliance_info.rb | db/migrate/20200513124526_fix_json_data_in_user_compliance_info.rb | # frozen_string_literal: true
class FixJsonDataInUserComplianceInfo < ActiveRecord::Migration
def up
UserComplianceInfo.where(json_data: nil).find_in_batches(batch_size: 5000) do |relation|
print "."
UserComplianceInfo.where(id: relation.map(&:id)).update_all(json_data: {})
sleep(0.01)
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130612230657_remove_stripe_fingerpring_uniqueness.rb | db/migrate/20130612230657_remove_stripe_fingerpring_uniqueness.rb | # frozen_string_literal: true
class RemoveStripeFingerpringUniqueness < ActiveRecord::Migration
def change
remove_index :credit_cards, name: "index_credit_cards_on_stripe_fingerprint_unique"
add_index :credit_cards, :stripe_fingerprint
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120426001332_add_stripe_finger_print_to_credit_cards.rb | db/migrate/20120426001332_add_stripe_finger_print_to_credit_cards.rb | # frozen_string_literal: true
class AddStripeFingerPrintToCreditCards < ActiveRecord::Migration
def change
add_column :credit_cards, :stripe_fingerprint, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210219002017_migrate_es_indices_document_type.rb | db/migrate/20210219002017_migrate_es_indices_document_type.rb | # frozen_string_literal: true
class MigrateEsIndicesDocumentType < ActiveRecord::Migration[6.1]
# Original migration: https://github.com/antiwork/gumroad/blob/main/db/migrate/20210219002017_migrate_es_indices_document_type.rb
def up
return if Rails.env.production?
DevTools.delete_all_indices_and_reindex_all
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20191126120036_add_deleted_at_to_custom_domain.rb | db/migrate/20191126120036_add_deleted_at_to_custom_domain.rb | # frozen_string_literal: true
class AddDeletedAtToCustomDomain < ActiveRecord::Migration
def up
add_column :custom_domains, :deleted_at, :datetime
end
def down
remove_column :custom_domains, :deleted_at
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130110043951_add_name_to_installments.rb | db/migrate/20130110043951_add_name_to_installments.rb | # frozen_string_literal: true
class AddNameToInstallments < ActiveRecord::Migration
def change
add_column :installments, :name, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120614220545_add_territory_restriction_to_links.rb | db/migrate/20120614220545_add_territory_restriction_to_links.rb | # frozen_string_literal: true
class AddTerritoryRestrictionToLinks < ActiveRecord::Migration
def change
add_column :links, :territory_restriction, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151105000003_add_funding_to_credit_cards.rb | db/migrate/20151105000003_add_funding_to_credit_cards.rb | # frozen_string_literal: true
class AddFundingToCreditCards < ActiveRecord::Migration
def change
add_column :credit_cards, :funding_type, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130211200402_create_event_test_paths_assignments_table.rb | db/migrate/20130211200402_create_event_test_paths_assignments_table.rb | # frozen_string_literal: true
class CreateEventTestPathsAssignmentsTable < ActiveRecord::Migration
def change
create_table :event_test_path_assignments do |t|
t.integer :event_id
t.string :event_name
t.string :active_test_paths
t.timestamps
end
add_index "event_test_path_assignments", ["event_id"], name: "index_event_test_path_assignments_on_event_id"
add_index "event_test_path_assignments", ["active_test_paths", "event_name"], name: "index_event_assignments_on_active_test_paths_and_event_name"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130419202456_add_preorder_id_to_purchases.rb | db/migrate/20130419202456_add_preorder_id_to_purchases.rb | # frozen_string_literal: true
class AddPreorderIdToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :preorder_id, :integer
add_index :purchases, :preorder_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20190916230459_resize_installments_slugs_column.rb | db/migrate/20190916230459_resize_installments_slugs_column.rb | # frozen_string_literal: true
class ResizeInstallmentsSlugsColumn < ActiveRecord::Migration
def up
safety_assured do
execute "ALTER TABLE `installments` CHANGE `slug` `slug` varchar(255) NULL COMMENT '';"
end
end
def down
safety_assured do
execute "ALTER TABLE `installments` CHANGE `slug` `slug` varchar(191) NULL COMMENT '';"
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231217195245_add_flags_to_seller_profile_sections.rb | db/migrate/20231217195245_add_flags_to_seller_profile_sections.rb | # frozen_string_literal: true
class AddFlagsToSellerProfileSections < ActiveRecord::Migration[7.0]
def change
add_column :seller_profile_sections, :flags, :bigint, default: 0, null: false
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240127222215_add_json_data_to_seller_profiles.rb | db/migrate/20240127222215_add_json_data_to_seller_profiles.rb | # frozen_string_literal: true
class AddJsonDataToSellerProfiles < ActiveRecord::Migration[7.0]
def change
add_column :seller_profiles, :json_data, :json
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150729222603_add_background_video_url_to_user.rb | db/migrate/20150729222603_add_background_video_url_to_user.rb | # frozen_string_literal: true
class AddBackgroundVideoUrlToUser < ActiveRecord::Migration
def change
add_column :users, :background_video_url, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240711191508_add_custom_field_id_to_purchase_custom_fields.rb | db/migrate/20240711191508_add_custom_field_id_to_purchase_custom_fields.rb | # frozen_string_literal: true
class AddCustomFieldIdToPurchaseCustomFields < ActiveRecord::Migration[7.1]
def change
add_reference :purchase_custom_fields, :custom_field
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20131209234409_index_offer_codes_on_link_id.rb | db/migrate/20131209234409_index_offer_codes_on_link_id.rb | # frozen_string_literal: true
class IndexOfferCodesOnLinkId < ActiveRecord::Migration
def up
add_index :offer_codes, :link_id
end
def down
remove_index :offer_codes, :link_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20250210153633_create_public_files.rb | db/migrate/20250210153633_create_public_files.rb | # frozen_string_literal: true
class CreatePublicFiles < ActiveRecord::Migration[7.1]
def change
create_table :public_files do |t|
t.references :seller
t.belongs_to :resource, polymorphic: true, null: false
t.string :public_id, null: false, index: { unique: true }
t.string :display_name, null: false
t.string :original_file_name, null: false
t.string :file_type, index: true
t.string :file_group, index: true
t.datetime :deleted_at, index: true
t.datetime :scheduled_for_deletion_at, index: true
t.text :json_data
t.timestamps
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130129062643_add_ach_account_id_to_payments.rb | db/migrate/20130129062643_add_ach_account_id_to_payments.rb | # frozen_string_literal: true
class AddAchAccountIdToPayments < ActiveRecord::Migration
def change
add_column :payments, :ach_account_id, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150513231714_create_product_files_archives.rb | db/migrate/20150513231714_create_product_files_archives.rb | # frozen_string_literal: true
class CreateProductFilesArchives < ActiveRecord::Migration
def change
create_table :product_files_archives do |t|
t.timestamp :deleted_at
t.belongs_to :link
t.belongs_to :installment
t.attachment :zip_archive_file
t.string :product_files_archive_state
t.timestamps
end
add_index :product_files_archives, :link_id
add_index :product_files_archives, :installment_id
create_table :product_files_files_archives do |t|
t.references :product_file
t.references :product_files_archive
end
add_index :product_files_files_archives, :product_files_archive_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130131044353_add_max_purchase_count_to_variants.rb | db/migrate/20130131044353_add_max_purchase_count_to_variants.rb | # frozen_string_literal: true
class AddMaxPurchaseCountToVariants < ActiveRecord::Migration
def change
add_column :variants, :max_purchase_count, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20190425220322_add_credit_card_to_subscription.rb | db/migrate/20190425220322_add_credit_card_to_subscription.rb | # frozen_string_literal: true
class AddCreditCardToSubscription < ActiveRecord::Migration
def change
add_column :subscriptions, :credit_card_id, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240703095722_add_review_reminder_scheduled_at_to_orders.rb | db/migrate/20240703095722_add_review_reminder_scheduled_at_to_orders.rb | # frozen_string_literal: true
class AddReviewReminderScheduledAtToOrders < ActiveRecord::Migration[7.1]
def change
add_column :orders, :review_reminder_scheduled_at, :datetime
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130117014416_create_variants.rb | db/migrate/20130117014416_create_variants.rb | # frozen_string_literal: true
class CreateVariants < ActiveRecord::Migration
def change
create_table :variants do |t|
t.integer :variant_category_id
t.integer :price_difference_cents
t.string :name
end
add_index :variants, :variant_category_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240929142017_add_price_update_attributes_to_subscription_plan_changes.rb | db/migrate/20240929142017_add_price_update_attributes_to_subscription_plan_changes.rb | # frozen_string_literal: true
class AddPriceUpdateAttributesToSubscriptionPlanChanges < ActiveRecord::Migration[7.1]
def change
change_table :subscription_plan_changes, bulk: true do |t|
t.date :effective_on
t.datetime :notified_subscriber_at
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150520185631_add_custom_sku_to_base_variant.rb | db/migrate/20150520185631_add_custom_sku_to_base_variant.rb | # frozen_string_literal: true
class AddCustomSkuToBaseVariant < ActiveRecord::Migration
def change
add_column :base_variants, :custom_sku, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120928230933_create_visits.rb | db/migrate/20120928230933_create_visits.rb | # frozen_string_literal: true
class CreateVisits < ActiveRecord::Migration
def change
create_table "visits", force: true do |t|
t.string "ip_address"
t.datetime "created_at"
t.string "entry_point"
t.datetime "updated_at"
t.string "fingerprint"
t.integer "user_id"
t.boolean "is_modal"
end
add_index "visits", ["created_at"], name: "index_visits_on_created_at"
add_index "visits", ["entry_point"], name: "index_visits_on_entry_point"
add_index "visits", ["fingerprint"], name: "index_visits_on_fingerprint"
add_index "visits", ["ip_address"], name: "index_visits_on_ip_address"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120226203405_change_framerate_to_integer.rb | db/migrate/20120226203405_change_framerate_to_integer.rb | # frozen_string_literal: true
class ChangeFramerateToInteger < ActiveRecord::Migration
def up
change_column :infos, :framerate, :integer
end
def down
change_column :infos, :framerate, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151016222520_increase_string_limit_for_fb.rb | db/migrate/20151016222520_increase_string_limit_for_fb.rb | # frozen_string_literal: true
class IncreaseStringLimitForFb < ActiveRecord::Migration
def change
change_column(:users, :facebook_access_token, :string, limit: 1024)
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150316206000_add_relationship_to_merchant_accounts.rb | db/migrate/20150316206000_add_relationship_to_merchant_accounts.rb | # frozen_string_literal: true
class AddRelationshipToMerchantAccounts < ActiveRecord::Migration
def change
add_column :merchant_accounts, :relationship, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210502195458_remove_asset_preview_columns.rb | db/migrate/20210502195458_remove_asset_preview_columns.rb | # frozen_string_literal: true
class RemoveAssetPreviewColumns < ActiveRecord::Migration[6.1]
def up
change_table :asset_previews do |t|
t.remove "attachment_file_name"
t.remove "attachment_content_type"
t.remove "attachment_file_size"
t.remove "attachment_updated_at"
t.remove "attachment_meta"
end
end
def down
change_table :asset_previews do |t|
t.string "attachment_file_name", limit: 2000
t.string "attachment_content_type"
t.integer "attachment_file_size"
t.datetime "attachment_updated_at"
t.text "attachment_meta"
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130124024615_add_last_4_and_name_to_ach_account.rb | db/migrate/20130124024615_add_last_4_and_name_to_ach_account.rb | # frozen_string_literal: true
class AddLast4AndNameToAchAccount < ActiveRecord::Migration
def change
add_column :ach_accounts, :account_number_last_four, :string
add_column :ach_accounts, :account_holder_full_name, :string
add_column :ach_accounts, :deleted_at, :datetime
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20221121182709_add_email_domain_to_purchases_index.rb | db/migrate/20221121182709_add_email_domain_to_purchases_index.rb | # frozen_string_literal: true
class AddEmailDomainToPurchasesIndex < ActiveRecord::Migration[7.0]
def up
EsClient.indices.put_mapping(
index: Purchase.index_name,
body: {
properties: {
email_domain: { type: "text", analyzer: "email", search_analyzer: "search_email" }
}
}
)
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240122125452_add_index_on_credits_balance_id.rb | db/migrate/20240122125452_add_index_on_credits_balance_id.rb | # frozen_string_literal: true
class AddIndexOnCreditsBalanceId < ActiveRecord::Migration[7.0]
def change
add_index :credits, :balance_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120718175247_add_framerate_to_links.rb | db/migrate/20120718175247_add_framerate_to_links.rb | # frozen_string_literal: true
class AddFramerateToLinks < ActiveRecord::Migration
def change
add_column :links, :framerate, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120423212135_change_credit_card_relation_to_users.rb | db/migrate/20120423212135_change_credit_card_relation_to_users.rb | # frozen_string_literal: true
class ChangeCreditCardRelationToUsers < ActiveRecord::Migration
def up
remove_column :credit_cards, :user_id
add_column :users, :credit_card_id, :integer
end
def down
add_column :credit_cards, :user_id, :integer
remove_column :users, :credit_card_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140722233234_remove_index_from_daily_metrics.rb | db/migrate/20140722233234_remove_index_from_daily_metrics.rb | # frozen_string_literal: true
class RemoveIndexFromDailyMetrics < ActiveRecord::Migration
def up
remove_index :daily_metrics, name: "index_daily_metrics_on_event_name_and_events_date"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20170718061532_add_paypal_order_id_to_purchases.rb | db/migrate/20170718061532_add_paypal_order_id_to_purchases.rb | # frozen_string_literal: true
class AddPaypalOrderIdToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :paypal_order_id, :string
add_index :purchases, :paypal_order_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140604015423_index_twitter_orders_on_purchase_id.rb | db/migrate/20140604015423_index_twitter_orders_on_purchase_id.rb | # frozen_string_literal: true
class IndexTwitterOrdersOnPurchaseId < ActiveRecord::Migration
def change
add_index :twitter_orders, :purchase_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120921184518_add_card_type_to_purchases.rb | db/migrate/20120921184518_add_card_type_to_purchases.rb | # frozen_string_literal: true
class AddCardTypeToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :card_type, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20250124140005_add_ip_address_and_browser_guid_to_utm_links.rb | db/migrate/20250124140005_add_ip_address_and_browser_guid_to_utm_links.rb | # frozen_string_literal: true
class AddIpAddressAndBrowserGuidToUtmLinks < ActiveRecord::Migration[7.1]
def change
change_table :utm_links, bulk: true do |t|
t.string :ip_address
t.string :browser_guid
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240329142630_add_index_for_user_tos_violation_reason.rb | db/migrate/20240329142630_add_index_for_user_tos_violation_reason.rb | # frozen_string_literal: true
class AddIndexForUserTosViolationReason < ActiveRecord::Migration[7.1]
def change
add_index :users, :tos_violation_reason
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111109005838_create_purchases.rb | db/migrate/20111109005838_create_purchases.rb | # frozen_string_literal: true
class CreatePurchases < ActiveRecord::Migration
def change
create_table :purchases do |t|
t.integer :user_id
t.string :unique_permalink
t.float :price
t.date :created_at
t.timestamps
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240115190703_add_deleted_at_to_wishlist_products.rb | db/migrate/20240115190703_add_deleted_at_to_wishlist_products.rb | # frozen_string_literal: true
class AddDeletedAtToWishlistProducts < ActiveRecord::Migration[7.0]
def change
add_column :wishlist_products, :deleted_at, :datetime
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20141031182759_add_installment_id_to_product_file.rb | db/migrate/20141031182759_add_installment_id_to_product_file.rb | # frozen_string_literal: true
class AddInstallmentIdToProductFile < ActiveRecord::Migration
def change
add_column :product_files, :installment_id, :integer
add_index :product_files, :installment_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150528180752_add_url_to_product_files_archive.rb | db/migrate/20150528180752_add_url_to_product_files_archive.rb | # frozen_string_literal: true
class AddUrlToProductFilesArchive < ActiveRecord::Migration
def change
add_column :product_files_archives, :url, :string
remove_column :product_files_archives, :zip_archive_file_file_name
remove_column :product_files_archives, :zip_archive_file_content_type
remove_column :product_files_archives, :zip_archive_file_file_size
remove_column :product_files_archives, :zip_archive_file_updated_at
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120803235629_add_common_color_to_link.rb | db/migrate/20120803235629_add_common_color_to_link.rb | # frozen_string_literal: true
class AddCommonColorToLink < ActiveRecord::Migration
def change
add_column :links, :common_color, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151102000000_add_failure_reason_to_payments.rb | db/migrate/20151102000000_add_failure_reason_to_payments.rb | # frozen_string_literal: true
class AddFailureReasonToPayments < ActiveRecord::Migration
def change
add_column :payments, :failure_reason, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121019231317_add_created_at_ip_to_users.rb | db/migrate/20121019231317_add_created_at_ip_to_users.rb | # frozen_string_literal: true
class AddCreatedAtIpToUsers < ActiveRecord::Migration
def up
add_column :users, :account_created_ip, :string
end
def down
remove_column :users, :account_created_ip, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20181120060941_migrate_invite_statuses.rb | db/migrate/20181120060941_migrate_invite_statuses.rb | # frozen_string_literal: true
class MigrateInviteStatuses < ActiveRecord::Migration
def up
Invite.where(invite_state: "paid_out").update_all(invite_state: "upgraded_to_pro")
Invite.where(invite_state: "made_sale").update_all(invite_state: "signed_up")
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120528233016_add_subunsub_to_purchases.rb | db/migrate/20120528233016_add_subunsub_to_purchases.rb | # frozen_string_literal: true
class AddSubunsubToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :subunsub, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130517003958_add_chargebacked_purchase_id_to_credits.rb | db/migrate/20130517003958_add_chargebacked_purchase_id_to_credits.rb | # frozen_string_literal: true
class AddChargebackedPurchaseIdToCredits < ActiveRecord::Migration
def change
add_column :credits, :chargebacked_purchase_id, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220419225846_add_type_to_affiliates.rb | db/migrate/20220419225846_add_type_to_affiliates.rb | # frozen_string_literal: true
class AddTypeToAffiliates < ActiveRecord::Migration[6.1]
def change
add_column :affiliates, :type, :string, null: false, default: "DirectAffiliate"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.