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/20120426001450_add_session_id_to_purchases.rb | db/migrate/20120426001450_add_session_id_to_purchases.rb | # frozen_string_literal: true
class AddSessionIdToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :session_id, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120919234302_add_suggested_price_cents_to_links.rb | db/migrate/20120919234302_add_suggested_price_cents_to_links.rb | # frozen_string_literal: true
class AddSuggestedPriceCentsToLinks < ActiveRecord::Migration
def change
add_column :links, :suggested_price_cents, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210106033416_add_missing_indices_to_affiliate_credits.rb | db/migrate/20210106033416_add_missing_indices_to_affiliate_credits.rb | # frozen_string_literal: true
class AddMissingIndicesToAffiliateCredits < ActiveRecord::Migration[6.0]
def change
change_table :affiliate_credits do |t|
t.index :affiliate_credit_refund_balance_id
t.index :affiliate_credit_success_balance_id
t.index :affiliate_credit_chargeback_balance_id, name... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20250425212934_add_back_admin_action_call_infos.rb | db/migrate/20250425212934_add_back_admin_action_call_infos.rb | # frozen_string_literal: true
class AddBackAdminActionCallInfos < ActiveRecord::Migration[7.1]
def change
create_table :admin_action_call_infos, charset: "utf8mb4", collation: "utf8mb4_unicode_ci" do |t|
t.string :controller_name, null: false
t.string :action_name, null: false
t.integer :call_c... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140117210119_add_flags_to_subscriptions.rb | db/migrate/20140117210119_add_flags_to_subscriptions.rb | # frozen_string_literal: true
class AddFlagsToSubscriptions < ActiveRecord::Migration
def change
add_column :subscriptions, :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/20150728160357_increase_length_of_asset_preview_url.rb | db/migrate/20150728160357_increase_length_of_asset_preview_url.rb | # frozen_string_literal: true
class IncreaseLengthOfAssetPreviewUrl < ActiveRecord::Migration
def change
change_column(:asset_previews, :attachment_file_name, :string, limit: 2000)
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120817004932_add_chargeback_date_to_purchases.rb | db/migrate/20120817004932_add_chargeback_date_to_purchases.rb | # frozen_string_literal: true
class AddChargebackDateToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :chargeback_date, :datetime
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20200821142223_create_versions.rb | db/migrate/20200821142223_create_versions.rb | # frozen_string_literal: true
# This migration creates the `versions` table, the only schema PT requires.
# All other migrations PT provides are optional.
class CreateVersions < ActiveRecord::Migration[5.0]
# The largest text column available in all supported RDBMS is
# 1024^3 - 1 bytes, roughly one gibibyte. We ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120521221756_add_preview_guid_to_links.rb | db/migrate/20120521221756_add_preview_guid_to_links.rb | # frozen_string_literal: true
class AddPreviewGuidToLinks < ActiveRecord::Migration
def up
add_column :links, :preview_guid, :string
end
def down
remove_column :links, :preview_guid
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150114194817_add_scopes_to_oauth_applications.rb | db/migrate/20150114194817_add_scopes_to_oauth_applications.rb | # frozen_string_literal: true
class AddScopesToOauthApplications < ActiveRecord::Migration
def change
add_column :oauth_applications, :scopes, :string, null: false, default: "" rescue nil
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111221011759_change_names_to_original.rb | db/migrate/20111221011759_change_names_to_original.rb | # frozen_string_literal: true
class ChangeNamesToOriginal < ActiveRecord::Migration
def up
Attachment.find_each do |attachment|
puts attachment.id
original_file_name = attachment.file_file_name
next unless original_file_name
# base = File.basename(original_file_name)
ext = File.extn... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20160120205707_add_discount_code_to_service_charge.rb | db/migrate/20160120205707_add_discount_code_to_service_charge.rb | # frozen_string_literal: true
class AddDiscountCodeToServiceCharge < ActiveRecord::Migration
def change
add_column :service_charges, :discount_code, :string, limit: 100
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20181009173358_update_category_names.rb | db/migrate/20181009173358_update_category_names.rb | # frozen_string_literal: true
class UpdateCategoryNames < ActiveRecord::Migration
def up
Category.where(name: "publishing").update_all(name: "writing")
Category.where(name: "physical").update_all(name: "merchandise")
end
def down
Category.where(name: "merchandise").update_all(name: "physical")
C... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120531180320_add_index_to_failed_purchases.rb | db/migrate/20120531180320_add_index_to_failed_purchases.rb | # frozen_string_literal: true
class AddIndexToFailedPurchases < ActiveRecord::Migration
def change
# Composite Key to enforce uniqueness and speed up searches.
add_index :failed_purchases, [:link_id, :stripe_fingerprint], unique: true, name: "by_link_and_stripe_fingerprint"
add_index :failed_purchases, :... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121129193009_added_card_brand_to_bins.rb | db/migrate/20121129193009_added_card_brand_to_bins.rb | # frozen_string_literal: true
class AddedCardBrandToBins < ActiveRecord::Migration
def up
add_column :bins, :card_brand, :string
end
def down
remove_column :bins, :card_brand
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210215094712_add_service_name_to_active_storage_blobs.active_storage.rb | db/migrate/20210215094712_add_service_name_to_active_storage_blobs.active_storage.rb | # frozen_string_literal: true
# This migration comes from active_storage (originally 20190112182829)
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
def up
unless column_exists?(:active_storage_blobs, :service_name)
add_column :active_storage_blobs, :service_name, :string
if ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210624025201_remove_unused_columns_from_url_redirects.rb | db/migrate/20210624025201_remove_unused_columns_from_url_redirects.rb | # frozen_string_literal: true
class RemoveUnusedColumnsFromUrlRedirects < ActiveRecord::Migration[6.1]
def up
execute <<~SQL
ALTER TABLE `url_redirects`
CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
DROP COLUMN `webhooked_url`,
DROP COLUMN `customized_file_url`,
CHANGE `id` `id`... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20250225091231_create_community_chat_messages.rb | db/migrate/20250225091231_create_community_chat_messages.rb | # frozen_string_literal: true
class CreateCommunityChatMessages < ActiveRecord::Migration[7.1]
def change
create_table :community_chat_messages do |t|
t.references :community, null: false
t.references :user, null: false
t.text :content, null: false, size: :long
t.datetime :deleted_at, ind... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151125215405_create_recurring_services.rb | db/migrate/20151125215405_create_recurring_services.rb | # frozen_string_literal: true
class CreateRecurringServices < ActiveRecord::Migration
def change
create_table :recurring_services, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.timestamps
t.references :user
t.string :type
t.integer :price_ce... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150416000000_create_tos_agreements.rb | db/migrate/20150416000000_create_tos_agreements.rb | # frozen_string_literal: true
class CreateTosAgreements < ActiveRecord::Migration
def change
create_table :tos_agreements, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.references :user
t.string :ip
t.column :created_at, :datetime
end
add_index :tos_agreement... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130910180507_add_refunder_to_refunds.rb | db/migrate/20130910180507_add_refunder_to_refunds.rb | # frozen_string_literal: true
class AddRefunderToRefunds < ActiveRecord::Migration
def up
add_column :refunds, :refunding_user_id, :integer
end
def down
remove_column :refunds, :refunding_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/20150605000000_add_stripe_connect_account_id_to_bank_accounts.rb | db/migrate/20150605000000_add_stripe_connect_account_id_to_bank_accounts.rb | # frozen_string_literal: true
class AddStripeConnectAccountIdToBankAccounts < ActiveRecord::Migration
def change
add_column :bank_accounts, :stripe_connect_account_id, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220729201912_remove_links_custom_fields.rb | db/migrate/20220729201912_remove_links_custom_fields.rb | # frozen_string_literal: true
class RemoveLinksCustomFields < ActiveRecord::Migration[6.1]
def up
remove_column :links, :custom_fields
end
def down
add_column :links, :custom_fields, :text, size: :medium
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150723011703_add_source_to_followers.rb | db/migrate/20150723011703_add_source_to_followers.rb | # frozen_string_literal: true
class AddSourceToFollowers < ActiveRecord::Migration
def change
add_column :followers, :source, :string
add_column :followers, :source_product_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/20111109223341_create_assets.rb | db/migrate/20111109223341_create_assets.rb | # frozen_string_literal: true
class CreateAssets < ActiveRecord::Migration
def change
create_table :assets do |t|
t.string :blob_key
t.string :file_name
t.integer :date
t.string :unique_permalink
t.string :file_type
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/20111122005722_index_receipts.rb | db/migrate/20111122005722_index_receipts.rb | # frozen_string_literal: true
class IndexReceipts < ActiveRecord::Migration
def up
add_index :receipts, :purchase_id
end
def down
remove_index :receipts, :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/20130410034200_create_compliance_entities.rb | db/migrate/20130410034200_create_compliance_entities.rb | # frozen_string_literal: true
class CreateComplianceEntities < ActiveRecord::Migration
def change
create_table :compliance_entities do |t|
t.string :source_list
t.integer :entity_number
t.string :sdn_type
t.string :programs
t.string :name
t.string :title
t.string :addres... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20250217233404_add_deleted_at_to_installment_plans.rb | db/migrate/20250217233404_add_deleted_at_to_installment_plans.rb | # frozen_string_literal: true
class AddDeletedAtToInstallmentPlans < ActiveRecord::Migration[7.1]
def change
change_table :product_installment_plans, bulk: true do |t|
t.datetime :deleted_at, default: nil, null: true
t.index :deleted_at
end
add_belongs_to :payment_options, :product_installme... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20211020222413_create_product_page_view_index.rb | db/migrate/20211020222413_create_product_page_view_index.rb | # frozen_string_literal: true
class CreateProductPageViewIndex < ActiveRecord::Migration[6.1]
def up
if Rails.env.production? || Rails.env.staging?
ProductPageView.__elasticsearch__.create_index!(index: "product_page_views_v1")
EsClient.indices.put_alias(name: "product_page_views", index: "product_pa... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20211214112715_remove_background_columns_from_users.rb | db/migrate/20211214112715_remove_background_columns_from_users.rb | # frozen_string_literal: true
class RemoveBackgroundColumnsFromUsers < ActiveRecord::Migration[6.1]
def up
change_table :users, bulk: true do |t|
t.remove :background_color
t.remove :background_image_url
end
end
def down
change_table :users, bulk: true do |t|
t.string :background_c... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240425113841_create_sent_abandoned_cart_emails.rb | db/migrate/20240425113841_create_sent_abandoned_cart_emails.rb | # frozen_string_literal: true
class CreateSentAbandonedCartEmails < ActiveRecord::Migration[7.1]
def change
create_table :sent_abandoned_cart_emails do |t|
t.references :cart, null: false
t.references :installment, 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/20160108192913_add_json_data_to_workflow.rb | db/migrate/20160108192913_add_json_data_to_workflow.rb | # frozen_string_literal: true
class AddJsonDataToWorkflow < ActiveRecord::Migration
def change
add_column :workflows, :json_data, :text
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151013211002_add_variant_ref_to_installments.rb | db/migrate/20151013211002_add_variant_ref_to_installments.rb | # frozen_string_literal: true
class AddVariantRefToInstallments < ActiveRecord::Migration
def change
add_reference :installments, :base_variant, index: true
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121115184907_remove_reset_password_index_from_users.rb | db/migrate/20121115184907_remove_reset_password_index_from_users.rb | # frozen_string_literal: true
class RemoveResetPasswordIndexFromUsers < ActiveRecord::Migration
def up
remove_index "users", "reset_password_token"
end
def down
add_index "users", "reset_password_token"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120516223533_add_sound_scan_fields_to_links.rb | db/migrate/20120516223533_add_sound_scan_fields_to_links.rb | # frozen_string_literal: true
class AddSoundScanFieldsToLinks < ActiveRecord::Migration
def change
add_column :links, :soundscan, :boolean
add_column :links, :upc_code, :string
add_column :links, :isrc_code, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150316205500_add_quantity_and_merchant_id_to_purchases.rb | db/migrate/20150316205500_add_quantity_and_merchant_id_to_purchases.rb | # frozen_string_literal: true
class AddQuantityAndMerchantIdToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :quantity, :integer, default: 1, null: false
add_column :purchases, :merchant_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/20111116194231_remove_assets.rb | db/migrate/20111116194231_remove_assets.rb | # frozen_string_literal: true
class RemoveAssets < ActiveRecord::Migration
def up
drop_table :assets
end
def down
create_table :assets do |t|
t.string :blob_key
t.string :file_name
t.integer :date
t.string :unique_permalink
t.string :file_type
t.timestamps
end
e... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231002212026_remove_shown_on_profile_from_products.rb | db/migrate/20231002212026_remove_shown_on_profile_from_products.rb | # frozen_string_literal: true
class RemoveShownOnProfileFromProducts < ActiveRecord::Migration[7.0]
def up
remove_column :links, :shown_on_profile
end
def down
change_table :links, bulk: true do |t|
t.column :shown_on_profile, :boolean, default: true
t.index :shown_on_profile
end
end
e... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20250330065025_remove_archived_at_from_affiliates.rb | db/migrate/20250330065025_remove_archived_at_from_affiliates.rb | # frozen_string_literal: true
class RemoveArchivedAtFromAffiliates < ActiveRecord::Migration[7.1]
def change
remove_column :affiliates, :archived_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/20231119164327_drop_user_recommended_root_taxonomies.rb | db/migrate/20231119164327_drop_user_recommended_root_taxonomies.rb | # frozen_string_literal: true
class DropUserRecommendedRootTaxonomies < ActiveRecord::Migration[7.0]
def up
drop_table :user_recommended_root_taxonomies
end
def down
create_table "user_recommended_root_taxonomies", charset: "utf8mb4", collation: "utf8mb4_unicode_ci" do |t|
t.bigint "user_id", null... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130524233006_add_attachment_icon_to_oauth_applications.rb | db/migrate/20130524233006_add_attachment_icon_to_oauth_applications.rb | # frozen_string_literal: true
class AddAttachmentIconToOauthApplications < ActiveRecord::Migration
def self.up
change_table :oauth_applications do |t|
t.has_attached_file :icon
end
end
def self.down
drop_attached_file :oauth_applications, :icon
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220201101203_create_taxonomy_hierarchies.rb | db/migrate/20220201101203_create_taxonomy_hierarchies.rb | # frozen_string_literal: true
class CreateTaxonomyHierarchies < ActiveRecord::Migration[6.1]
def change
create_table :taxonomy_hierarchies, id: false do |t|
t.bigint :ancestor_id, null: false
t.bigint :descendant_id, null: false
t.integer :generations, null: false
end
add_index :taxono... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150616174834_add_affiliate_id_to_affiliate_credits.rb | db/migrate/20150616174834_add_affiliate_id_to_affiliate_credits.rb | # frozen_string_literal: true
class AddAffiliateIdToAffiliateCredits < ActiveRecord::Migration
def change
add_column :affiliate_credits, :affiliate_id, :integer
add_index :affiliate_credits, :affiliate_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220302222428_add_taxonomy_id_to_products_index.rb | db/migrate/20220302222428_add_taxonomy_id_to_products_index.rb | # frozen_string_literal: true
class AddTaxonomyIdToProductsIndex < ActiveRecord::Migration[6.1]
def up
EsClient.indices.put_mapping(
index: Link.index_name,
body: {
properties: {
taxonomy_id: { type: "long" },
}
}
)
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210511080203_create_self_service_affiliate_products.rb | db/migrate/20210511080203_create_self_service_affiliate_products.rb | # frozen_string_literal: true
class CreateSelfServiceAffiliateProducts < ActiveRecord::Migration[6.1]
def change
create_table :self_service_affiliate_products do |t|
t.references :seller, type: :bigint, null: false, index: true
t.references :product, type: :bigint, null: false, index: { unique: true ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20200615140849_add_confidential_to_applications.rb | db/migrate/20200615140849_add_confidential_to_applications.rb | # frozen_string_literal: true
class AddConfidentialToApplications < ActiveRecord::Migration
def up
# Default generated is true. We set this to false for backwards compat
# https://github.com/doorkeeper-gem/doorkeeper/wiki/Migration-from-old-versions#database-changes-1
add_column :oauth_applications, :con... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120718174747_add_filetype_to_links.rb | db/migrate/20120718174747_add_filetype_to_links.rb | # frozen_string_literal: true
class AddFiletypeToLinks < ActiveRecord::Migration
def change
add_column :links, :filetype, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20201221121547_add_processor_payment_method_id_to_credit_card.rb | db/migrate/20201221121547_add_processor_payment_method_id_to_credit_card.rb | # frozen_string_literal: true
class AddProcessorPaymentMethodIdToCreditCard < ActiveRecord::Migration[6.0]
def change
add_column :credit_cards, :processor_payment_method_id, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111209003710_add_email_required_on_link.rb | db/migrate/20111209003710_add_email_required_on_link.rb | # frozen_string_literal: true
class AddEmailRequiredOnLink < ActiveRecord::Migration
def up
add_column :links, :email_required, :boolean, default: 0
add_column :purchases, :email, :text
end
def down
remove_column :links, :email_required
remove_column :purchases, :email, :text
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20190520204751_add_megaphone_states.rb | db/migrate/20190520204751_add_megaphone_states.rb | # frozen_string_literal: true
class AddMegaphoneStates < ActiveRecord::Migration
def change
create_table :megaphone_states do |t|
t.integer :user_id
t.bigint :flags, null: false, default: 0
end
add_index :megaphone_states, :user_id, unique: true
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210519182305_create_purchase_wallet_types.rb | db/migrate/20210519182305_create_purchase_wallet_types.rb | # frozen_string_literal: true
class CreatePurchaseWalletTypes < ActiveRecord::Migration[6.1]
def change
create_table :purchase_wallet_types do |t|
t.references :purchase, index: { unique: true }, null: false
t.string :wallet_type, index: true, null: false
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220329131939_create_top_sellers.rb | db/migrate/20220329131939_create_top_sellers.rb | # frozen_string_literal: true
class CreateTopSellers < ActiveRecord::Migration[6.1]
def change
create_table :top_sellers do |t|
t.bigint :user_id, null: false, index: { unique: true }
t.bigint :sales_usd, default: 0, null: false
t.bigint :sales_count, default: 0, null: false
t.integer :ra... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20190504212349_sync_dev_columns_lengths_and_positions.rb | db/migrate/20190504212349_sync_dev_columns_lengths_and_positions.rb | # frozen_string_literal: true
class SyncDevColumnsLengthsAndPositions < ActiveRecord::Migration
def up
VARCHARS_CHANGES_FROM_191_TO_255.each do |table_name, columns_names|
columns_names.each do |column_name|
change_column(table_name, column_name, :string, limit: 255)
end
end
TEXTS_CH... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20131104184424_add_account_type_to_bank_account.rb | db/migrate/20131104184424_add_account_type_to_bank_account.rb | # frozen_string_literal: true
class AddAccountTypeToBankAccount < ActiveRecord::Migration
def change
add_column :bank_accounts, :account_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/20190427161332_add_purchases_seller_state_date_index.rb | db/migrate/20190427161332_add_purchases_seller_state_date_index.rb | # frozen_string_literal: true
class AddPurchasesSellerStateDateIndex < ActiveRecord::Migration
def change
add_index :purchases, [:seller_id, :purchase_state, :created_at]
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231123113306_remove_url_from_base_variants.rb | db/migrate/20231123113306_remove_url_from_base_variants.rb | # frozen_string_literal: true
class RemoveUrlFromBaseVariants < ActiveRecord::Migration[7.0]
def up
remove_column :base_variants, :url
end
def down
add_column :base_variants, :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/20150814212030_add_consumed_at_and_media_location_to_consumption_events.rb | db/migrate/20150814212030_add_consumed_at_and_media_location_to_consumption_events.rb | # frozen_string_literal: true
class AddConsumedAtAndMediaLocationToConsumptionEvents < ActiveRecord::Migration
def change
add_column :consumption_events, :consumed_at, :datetime
add_column :consumption_events, :media_location, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120526043012_add_can_contact_to_purchases.rb | db/migrate/20120526043012_add_can_contact_to_purchases.rb | # frozen_string_literal: true
class AddCanContactToPurchases < ActiveRecord::Migration
def up
change_table :purchases do |t|
t.boolean :can_contact, default: true
end
Purchase.update_all ["can_contact = ?", true]
end
def down
remove_column :purchases, :can_contact
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230821194317_create_seller_profile_sections.rb | db/migrate/20230821194317_create_seller_profile_sections.rb | # frozen_string_literal: true
class CreateSellerProfileSections < ActiveRecord::Migration[7.0]
def change
create_table :seller_profile_sections do |t|
t.references :seller, index: true, null: false
t.string :header
t.text :shown_products, null: false
t.boolean :show_filters, null: false
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230612153224_add_minimum_quantity_to_offer_codes.rb | db/migrate/20230612153224_add_minimum_quantity_to_offer_codes.rb | # frozen_string_literal: true
class AddMinimumQuantityToOfferCodes < ActiveRecord::Migration[7.0]
def change
change_table :offer_codes, bulk: true do |t|
t.integer "minimum_quantity"
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151104000000_add_credit_card_id_to_bank_accounts.rb | db/migrate/20151104000000_add_credit_card_id_to_bank_accounts.rb | # frozen_string_literal: true
class AddCreditCardIdToBankAccounts < ActiveRecord::Migration
def change
add_column :bank_accounts, :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/20151008034224_add_json_data_to_payments.rb | db/migrate/20151008034224_add_json_data_to_payments.rb | # frozen_string_literal: true
class AddJsonDataToPayments < ActiveRecord::Migration
def change
add_column :payments, :json_data, :text
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20250116082729_add_unique_index_on_utm_columns_of_utm_links.rb | db/migrate/20250116082729_add_unique_index_on_utm_columns_of_utm_links.rb | # frozen_string_literal: true
class AddUniqueIndexOnUtmColumnsOfUtmLinks < ActiveRecord::Migration[7.1]
def up
change_table :utm_links, bulk: true do |t|
t.change :utm_source, :string, limit: 64, null: false
t.change :utm_medium, :string, limit: 64, null: false
t.change :utm_campaign, :string, ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120817014544_remove_chargebacked_from_purchases.rb | db/migrate/20120817014544_remove_chargebacked_from_purchases.rb | # frozen_string_literal: true
class RemoveChargebackedFromPurchases < ActiveRecord::Migration
def up
remove_column :purchases, :chargebacked
end
def down
add_column :purchases, :chargebacked, :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/20210530215102_add_folder_id_to_product_files.rb | db/migrate/20210530215102_add_folder_id_to_product_files.rb | # frozen_string_literal: true
class AddFolderIdToProductFiles < ActiveRecord::Migration[6.1]
def change
change_table :product_files do |t|
t.bigint :folder_id
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120615200410_add_variants_to_purchases.rb | db/migrate/20120615200410_add_variants_to_purchases.rb | # frozen_string_literal: true
class AddVariantsToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :variants, :text
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240222233850_create_processor_payment_intents.rb | db/migrate/20240222233850_create_processor_payment_intents.rb | # frozen_string_literal: true
class CreateProcessorPaymentIntents < ActiveRecord::Migration[7.1]
def change
create_table :processor_payment_intents do |t|
t.bigint :purchase_id, null: false, index: { unique: true }
t.string :intent_id, null: false, index: true
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/20230121043012_add_clicks_to_discover_searches.rb | db/migrate/20230121043012_add_clicks_to_discover_searches.rb | # frozen_string_literal: true
class AddClicksToDiscoverSearches < ActiveRecord::Migration[7.0]
def change
add_reference :discover_searches, :clicked_resource, polymorphic: true
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130610232658_add_name_and_link_id_index_to_offer_codes.rb | db/migrate/20130610232658_add_name_and_link_id_index_to_offer_codes.rb | # frozen_string_literal: true
class AddNameAndLinkIdIndexToOfferCodes < ActiveRecord::Migration
def change
add_index :offer_codes, [:name, :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/20250317100111_create_community_chat_recap_runs.rb | db/migrate/20250317100111_create_community_chat_recap_runs.rb | # frozen_string_literal: true
class CreateCommunityChatRecapRuns < ActiveRecord::Migration[7.1]
def change
create_table :community_chat_recap_runs do |t|
t.string :recap_frequency, null: false, index: true
t.datetime :from_date, null: false
t.datetime :to_date, null: false
t.integer :reca... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20250225092546_create_last_read_community_chat_messages.rb | db/migrate/20250225092546_create_last_read_community_chat_messages.rb | # frozen_string_literal: true
class CreateLastReadCommunityChatMessages < ActiveRecord::Migration[7.1]
def change
create_table :last_read_community_chat_messages do |t|
t.references :user, null: false
t.references :community, null: false
t.references :community_chat_message, null: false
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151221210133_remove_user_column_from_email_info.rb | db/migrate/20151221210133_remove_user_column_from_email_info.rb | # frozen_string_literal: true
class RemoveUserColumnFromEmailInfo < ActiveRecord::Migration
def change
remove_column :email_infos, :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/20141028183040_remove_index_on_deleted_at.rb | db/migrate/20141028183040_remove_index_on_deleted_at.rb | # frozen_string_literal: true
class RemoveIndexOnDeletedAt < ActiveRecord::Migration
def change
remove_index :links, :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/20150922003020_create_import_jobs.rb | db/migrate/20150922003020_create_import_jobs.rb | # frozen_string_literal: true
class CreateImportJobs < ActiveRecord::Migration
def change
create_table :import_jobs, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.string :import_file_url
t.integer :user_id
t.integer :link_id
t.string :state
t.integer :flags,... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140725195455_add_amount_percentage_column_to_offer_codes.rb | db/migrate/20140725195455_add_amount_percentage_column_to_offer_codes.rb | # frozen_string_literal: true
class AddAmountPercentageColumnToOfferCodes < ActiveRecord::Migration
def change
add_column :offer_codes, :amount_percentage, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20170125203547_create_oauth_authorizations.rb | db/migrate/20170125203547_create_oauth_authorizations.rb | # frozen_string_literal: true
class CreateOauthAuthorizations < ActiveRecord::Migration
def change
create_table :oauth_authorizations do |t|
t.integer :user_id, index: true
t.integer :provider
t.string :access_token
t.string :refresh_token
t.datetime :expires_at
t.string :prov... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20141007071105_add_user_id_to_offer_codes.rb | db/migrate/20141007071105_add_user_id_to_offer_codes.rb | # frozen_string_literal: true
class AddUserIdToOfferCodes < ActiveRecord::Migration
def change
add_column :offer_codes, :user_id, :integer
add_index :offer_codes, [:user_id], name: "index_offer_codes_on_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/20120718175531_add_height_to_links.rb | db/migrate/20120718175531_add_height_to_links.rb | # frozen_string_literal: true
class AddHeightToLinks < ActiveRecord::Migration
def change
add_column :links, :height, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20201103221330_remove_applied_at_from_subscription_plan_changes.rb | db/migrate/20201103221330_remove_applied_at_from_subscription_plan_changes.rb | # frozen_string_literal: true
class RemoveAppliedAtFromSubscriptionPlanChanges < ActiveRecord::Migration[6.0]
def up
safety_assured { remove_column :subscription_plan_changes, :applied_at }
end
def down
add_column :subscription_plan_changes, :applied_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/20250103124729_create_utm_links.rb | db/migrate/20250103124729_create_utm_links.rb | # frozen_string_literal: true
class CreateUtmLinks < ActiveRecord::Migration[7.1]
def change
create_table :utm_links do |t|
t.references :seller, null: false
t.string :title, null: false
t.string :target_resource_type, null: false
t.string :target_resource_id
t.string :permalink, nu... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151028153410_add_product_categories.rb | db/migrate/20151028153410_add_product_categories.rb | # frozen_string_literal: true
class AddProductCategories < ActiveRecord::Migration
def change
create_table(:categories) do |t|
t.string(:name, limit: 100)
t.timestamps
end
add_index(:categories, :name)
create_table(:product_categorizations) do |t|
t.belongs_to(:category)
t.be... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120112224613_add_token_to_url_redirect.rb | db/migrate/20120112224613_add_token_to_url_redirect.rb | # frozen_string_literal: true
class AddTokenToUrlRedirect < ActiveRecord::Migration
def change
add_column :url_redirects, :token, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20201207034544_remove_unused_parents_chidren.rb | db/migrate/20201207034544_remove_unused_parents_chidren.rb | # frozen_string_literal: true
class RemoveUnusedParentsChidren < ActiveRecord::Migration[6.0]
def up
drop_table :parents_children
end
def down
create_table "parents_children", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t|
t.integer "... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151022194039_add_country_to_bank_accounts.rb | db/migrate/20151022194039_add_country_to_bank_accounts.rb | # frozen_string_literal: true
class AddCountryToBankAccounts < ActiveRecord::Migration
def change
add_column :bank_accounts, :country, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121005010456_add_card_country_to_purchases.rb | db/migrate/20121005010456_add_card_country_to_purchases.rb | # frozen_string_literal: true
class AddCardCountryToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :card_country, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220712175710_add_index_to_installments.rb | db/migrate/20220712175710_add_index_to_installments.rb | # frozen_string_literal: true
class AddIndexToInstallments < ActiveRecord::Migration[6.1]
def change
add_index :installments, :created_at
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121018174416_add_friend_actions_to_events.rb | db/migrate/20121018174416_add_friend_actions_to_events.rb | # frozen_string_literal: true
class AddFriendActionsToEvents < ActiveRecord::Migration
def change
add_column :events, :friend_actions, :text
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121018032034_add_external_id_to_users.rb | db/migrate/20121018032034_add_external_id_to_users.rb | # frozen_string_literal: true
class AddExternalIdToUsers < ActiveRecord::Migration
def change
add_column :users, :external_id, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20250120143213_make_utm_link_visits_country_code_nullable.rb | db/migrate/20250120143213_make_utm_link_visits_country_code_nullable.rb | # frozen_string_literal: true
class MakeUtmLinkVisitsCountryCodeNullable < ActiveRecord::Migration[7.1]
def change
change_column_null :utm_link_visits, :country_code, true
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230707223804_remove_category_tables.rb | db/migrate/20230707223804_remove_category_tables.rb | # frozen_string_literal: true
class RemoveCategoryTables < ActiveRecord::Migration[7.0]
def up
drop_table :categories
drop_table :product_categorizations
drop_table :user_categorizations
end
def down
create_table "categories", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci" do ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20211013114048_change_product_folder_name.rb | db/migrate/20211013114048_change_product_folder_name.rb | # frozen_string_literal: true
class ChangeProductFolderName < ActiveRecord::Migration[6.1]
def up
change_column :product_folders, :name, :string, null: false
end
def down
change_column :product_folders, :name, :string, null: true
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140528235035_create_twitter_merchants.rb | db/migrate/20140528235035_create_twitter_merchants.rb | # frozen_string_literal: true
class CreateTwitterMerchants < ActiveRecord::Migration
def change
create_table :twitter_merchants do |t|
t.references :user
t.string :email
t.string :name
t.string :support_email
t.string :domains
t.integer :twitter_assign... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130419202453_create_preorders.rb | db/migrate/20130419202453_create_preorders.rb | # frozen_string_literal: true
class CreatePreorders < ActiveRecord::Migration
def change
create_table :preorders do |t|
t.references :preorder_link, null: false
t.references :seller, null: false
t.references :purchaser
t.string :state, null: false
t.timestamps
end
add_index... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240620200757_create_call_limitation_infos.rb | db/migrate/20240620200757_create_call_limitation_infos.rb | # frozen_string_literal: true
class CreateCallLimitationInfos < ActiveRecord::Migration[7.1]
def change
create_table :call_limitation_infos do |t|
t.references :call, null: false
t.integer :minimum_notice_in_minutes
t.integer :maximum_calls_per_day
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/20120816213321_add_default_for_filetype.rb | db/migrate/20120816213321_add_default_for_filetype.rb | # frozen_string_literal: true
class AddDefaultForFiletype < ActiveRecord::Migration
def up
change_column :links, :filetype, :string, default: "link"
change_column :links, :filegroup, :string, default: "url"
end
def down
change_column :links, :filetype, :string, default: nil
change_column :links,... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150915174708_increase_length_of_s3_url_fields.rb | db/migrate/20150915174708_increase_length_of_s3_url_fields.rb | # frozen_string_literal: true
class IncreaseLengthOfS3UrlFields < ActiveRecord::Migration
def change
change_column(:product_files, :url, :string, limit: 1024)
change_column(:processed_audios, :url, :string, limit: 1024)
change_column(:product_files_archives, :url, :string, limit: 1024)
change_column(... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120711045354_add_ban_queued_to_users.rb | db/migrate/20120711045354_add_ban_queued_to_users.rb | # frozen_string_literal: true
class AddBanQueuedToUsers < ActiveRecord::Migration
def change
add_column :users, :ban_queued, :boolean
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230104184824_create_team_invitations.rb | db/migrate/20230104184824_create_team_invitations.rb | # frozen_string_literal: true
class CreateTeamInvitations < ActiveRecord::Migration[7.0]
def change
create_table :team_invitations do |t|
t.bigint :seller_id, null: false
t.string :email, null: false
t.string :role, null: false
t.timestamps
t.datetime :expires_at, null: false
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210405121212_drop_unnecessary_indexes.rb | db/migrate/20210405121212_drop_unnecessary_indexes.rb | # frozen_string_literal: true
class DropUnnecessaryIndexes < ActiveRecord::Migration[6.1]
def change
remove_index :service_charges, :processor_payment_intent_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121031180805_add_webhook_url_to_links.rb | db/migrate/20121031180805_add_webhook_url_to_links.rb | # frozen_string_literal: true
class AddWebhookUrlToLinks < ActiveRecord::Migration
def change
add_column :links, :webhook_url, :text
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.