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/20130206224735_add_purchase_id_to_subscriptions.rb | db/migrate/20130206224735_add_purchase_id_to_subscriptions.rb | # frozen_string_literal: true
class AddPurchaseIdToSubscriptions < ActiveRecord::Migration
def change
add_column :subscriptions, :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/20120914010510_create_payments.rb | db/migrate/20120914010510_create_payments.rb | # frozen_string_literal: true
class CreatePayments < ActiveRecord::Migration
def change
create_table :payments do |t|
t.references :user
t.string :status
t.text :status_data
t.float :amount
t.timestamps
end
add_index :payments, :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/20250225094113_create_community_notification_settings.rb | db/migrate/20250225094113_create_community_notification_settings.rb | # frozen_string_literal: true
class CreateCommunityNotificationSettings < ActiveRecord::Migration[7.1]
def change
create_table :community_notification_settings do |t|
t.references :user, null: false
t.references :seller, null: false
t.string :recap_frequency, index: true
t.timestamps
t.index [:user_id, :seller_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/20210323175710_drop_facebook_profile_from_users.rb | db/migrate/20210323175710_drop_facebook_profile_from_users.rb | # frozen_string_literal: true
class DropFacebookProfileFromUsers < ActiveRecord::Migration[6.1]
def change
remove_column :users, :facebook_profile, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20190613024033_add_missing_index_on_imported_customers.rb | db/migrate/20190613024033_add_missing_index_on_imported_customers.rb | # frozen_string_literal: true
class AddMissingIndexOnImportedCustomers < ActiveRecord::Migration
def up
add_index :imported_customers, [:link_id, :purchase_date]
end
def down
remove_index :imported_customers, [:link_id, :purchase_date]
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210722183722_add_flags_to_refunds.rb | db/migrate/20210722183722_add_flags_to_refunds.rb | # frozen_string_literal: true
class AddFlagsToRefunds < ActiveRecord::Migration[6.1]
def change
add_column :refunds, :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/20240830231925_add_stats_to_wishlists.rb | db/migrate/20240830231925_add_stats_to_wishlists.rb | # frozen_string_literal: true
class AddStatsToWishlists < ActiveRecord::Migration[7.1]
def change
change_table :wishlists, bulk: true do |t|
t.integer :flags, default: 0, null: false
t.boolean :recommendable, default: false, null: false
t.integer :follower_count, default: 0, null: false
t.integer :recent_follower_count, default: 0, null: false
t.index [:recommendable, :recent_follower_count]
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151016000000_add_deleted_at_charge_processor_at_to_merchant_account.rb | db/migrate/20151016000000_add_deleted_at_charge_processor_at_to_merchant_account.rb | # frozen_string_literal: true
class AddDeletedAtChargeProcessorAtToMerchantAccount < ActiveRecord::Migration
def change
add_column :merchant_accounts, :charge_processor_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/20151005000000_remove_tax_id_type_columns_from_user_compliance_info.rb | db/migrate/20151005000000_remove_tax_id_type_columns_from_user_compliance_info.rb | # frozen_string_literal: true
class RemoveTaxIdTypeColumnsFromUserComplianceInfo < ActiveRecord::Migration
def change
remove_column :user_compliance_info, :individual_tax_id_type
remove_column :user_compliance_info, :business_tax_id_type
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210831170318_add_orientation_priority_tag_to_user.rb | db/migrate/20210831170318_add_orientation_priority_tag_to_user.rb | # frozen_string_literal: true
class AddOrientationPriorityTagToUser < ActiveRecord::Migration[6.1]
def change
add_column :users, :orientation_priority_tag, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130220170734_create_sxsw_meetings.rb | db/migrate/20130220170734_create_sxsw_meetings.rb | # frozen_string_literal: true
class CreateSxswMeetings < ActiveRecord::Migration
def change
create_table :sxsw_meetings do |t|
t.string :email
t.string :name
t.integer :time_slot
t.boolean :confirmed
t.text :message
t.string :guest_name
t.string :guest_email
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/20230903162345_create_bundle_products.rb | db/migrate/20230903162345_create_bundle_products.rb | # frozen_string_literal: true
class CreateBundleProducts < ActiveRecord::Migration[7.0]
def change
create_table :bundle_products do |t|
t.references :bundle, null: false
t.references :product, null: false
t.references :variant
t.integer :quantity, null: false
t.datetime :deleted_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/20150330045333_create_shipping_destinations.rb | db/migrate/20150330045333_create_shipping_destinations.rb | # frozen_string_literal: true
class CreateShippingDestinations < ActiveRecord::Migration
def change
create_table :shipping_destinations do |t|
t.integer :link_id
t.integer :user_id
t.string :country_code2, null: false
t.integer :standalone_rate_cents, null: false
t.integer :combined_rate_cents, null: false
t.integer :flags, default: 0, null: false
t.text :json_data
end
add_index(:shipping_destinations, :link_id)
add_index(:shipping_destinations, :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/20120928211939_add_seller_id_index_to_purchases.rb | db/migrate/20120928211939_add_seller_id_index_to_purchases.rb | # frozen_string_literal: true
class AddSellerIdIndexToPurchases < ActiveRecord::Migration
def change
add_index :purchases, :seller_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150615223017_add_affiliate_id_to_purchases.rb | db/migrate/20150615223017_add_affiliate_id_to_purchases.rb | # frozen_string_literal: true
class AddAffiliateIdToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :affiliate_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/20121129184816_create_bins.rb | db/migrate/20121129184816_create_bins.rb | # frozen_string_literal: true
class CreateBins < ActiveRecord::Migration
def change
create_table :bins do |t|
t.string :card_bin
t.string :issuing_bank
t.string :card_type
t.string :card_level
t.string :iso_country_name
t.string :iso_country_a2
t.string :iso_country_a3
t.integer :iso_country_number
t.string :website
t.string :phone_number
end
add_index :bins, :card_bin
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150916014404_increase_length_of_display_name.rb | db/migrate/20150916014404_increase_length_of_display_name.rb | # frozen_string_literal: true
class IncreaseLengthOfDisplayName < ActiveRecord::Migration
def change
change_column(:product_files, :display_name, :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/20130508030638_add_custom_download_text_to_links.rb | db/migrate/20130508030638_add_custom_download_text_to_links.rb | # frozen_string_literal: true
class AddCustomDownloadTextToLinks < ActiveRecord::Migration
def change
add_column :links, :custom_download_text, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240926112759_add_accepeted_offer_details_to_cart_products.rb | db/migrate/20240926112759_add_accepeted_offer_details_to_cart_products.rb | # frozen_string_literal: true
class AddAccepetedOfferDetailsToCartProducts < ActiveRecord::Migration[7.1]
def change
add_column :cart_products, :accepted_offer_details, :json
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20171130080044_create_index_on_stripe_transaction_id_in_purchases.rb | db/migrate/20171130080044_create_index_on_stripe_transaction_id_in_purchases.rb | # frozen_string_literal: true
class CreateIndexOnStripeTransactionIdInPurchases < ActiveRecord::Migration
def change
add_index :purchases, :stripe_transaction_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210804093658_add_tier_state_to_user.rb | db/migrate/20210804093658_add_tier_state_to_user.rb | # frozen_string_literal: true
class AddTierStateToUser < ActiveRecord::Migration[6.1]
def change
add_column :users, :tier_state, :integer, 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/20141218034930_add_time_period_and_rename_relative_delivery_time_to_duration_installment_rule.rb | db/migrate/20141218034930_add_time_period_and_rename_relative_delivery_time_to_duration_installment_rule.rb | # frozen_string_literal: true
class AddTimePeriodAndRenameRelativeDeliveryTimeToDurationInstallmentRule < ActiveRecord::Migration
def change
add_column :installment_rules, :time_period, :string
rename_column :installment_rules, :relative_delivery_time, :delayed_delivery_time
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140605195555_create_purchase_codes.rb | db/migrate/20140605195555_create_purchase_codes.rb | # frozen_string_literal: true
class CreatePurchaseCodes < ActiveRecord::Migration
def change
create_table :purchase_codes, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci" do |t|
t.string :token
t.datetime :used_at
t.datetime :expires_at
t.integer :url_redirect_id
t.timestamps
end
add_index :purchase_codes, :token
add_index :purchase_codes, :url_redirect_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120426222532_add_author_to_infos.rb | db/migrate/20120426222532_add_author_to_infos.rb | # frozen_string_literal: true
class AddAuthorToInfos < ActiveRecord::Migration
def change
add_column :infos, :author, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130717234545_add_json_data_to_users.rb | db/migrate/20130717234545_add_json_data_to_users.rb | # frozen_string_literal: true
class AddJsonDataToUsers < ActiveRecord::Migration
def change
add_column :users, :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/20200111113222_add_sent_email_infos_index_on_created_at.rb | db/migrate/20200111113222_add_sent_email_infos_index_on_created_at.rb | # frozen_string_literal: true
class AddSentEmailInfosIndexOnCreatedAt < ActiveRecord::Migration
def up
add_index :sent_email_infos, :created_at
end
def down
remove_index :sent_email_infos, :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/20240528201330_add_flags_to_custom_fields.rb | db/migrate/20240528201330_add_flags_to_custom_fields.rb | # frozen_string_literal: true
class AddFlagsToCustomFields < ActiveRecord::Migration[7.1]
def change
add_column :custom_fields, :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/20240826185245_add_google_calendar_event_id_to_calls.rb | db/migrate/20240826185245_add_google_calendar_event_id_to_calls.rb | # frozen_string_literal: true
class AddGoogleCalendarEventIdToCalls < ActiveRecord::Migration[7.1]
def change
add_column :calls, :google_calendar_event_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/20231205052835_add_state_code_to_purchase_sales_tax_infos.rb | db/migrate/20231205052835_add_state_code_to_purchase_sales_tax_infos.rb | # frozen_string_literal: true
class AddStateCodeToPurchaseSalesTaxInfos < ActiveRecord::Migration[7.0]
def change
add_column :purchase_sales_tax_infos, :state_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/20150804000001_add_currency_to_merchant_accounts.rb | db/migrate/20150804000001_add_currency_to_merchant_accounts.rb | # frozen_string_literal: true
class AddCurrencyToMerchantAccounts < ActiveRecord::Migration
def change
add_column :merchant_accounts, :currency, :string, default: "usd"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20200904153310_change_versions_id_type.rb | db/migrate/20200904153310_change_versions_id_type.rb | # frozen_string_literal: true
class ChangeVersionsIdType < ActiveRecord::Migration[5.2]
def up
safety_assured do
change_column :versions, :id, :bigint, null: false, unique: true, auto_increment: true
end
end
def down
safety_assured do
change_column :versions, :id, :int, null: false, unique: true, auto_increment: 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/20251028084435_create_user_tax_forms.rb | db/migrate/20251028084435_create_user_tax_forms.rb | # frozen_string_literal: true
class CreateUserTaxForms < ActiveRecord::Migration[7.1]
def change
create_table :user_tax_forms do |t|
t.references :user, null: false, index: true
t.integer :tax_year, null: false
t.string :tax_form_type, null: false
t.text :json_data
t.timestamps
t.index [:user_id, :tax_year, :tax_form_type], 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/20221019103316_add_deleted_at_to_rich_contents.rb | db/migrate/20221019103316_add_deleted_at_to_rich_contents.rb | # frozen_string_literal: true
class AddDeletedAtToRichContents < ActiveRecord::Migration[6.1]
def change
add_column :rich_contents, :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/20200620103947_add_variant_id_to_product_files_archives.rb | db/migrate/20200620103947_add_variant_id_to_product_files_archives.rb | # frozen_string_literal: true
class AddVariantIdToProductFilesArchives < ActiveRecord::Migration
def change
add_reference :product_files_archives, :variant, index: true
add_foreign_key :product_files_archives, :base_variants, column: :variant_id, on_delete: :cascade
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130315002301_add_index_on_link_id_to_variant_categories.rb | db/migrate/20130315002301_add_index_on_link_id_to_variant_categories.rb | # frozen_string_literal: true
class AddIndexOnLinkIdToVariantCategories < ActiveRecord::Migration
def change
add_index :variant_categories, :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/20130718052437_index_purchases_on_email.rb | db/migrate/20130718052437_index_purchases_on_email.rb | # frozen_string_literal: true
class IndexPurchasesOnEmail < ActiveRecord::Migration
def change
add_index :purchases, :email, length: 10
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20171218105118_add_column_confirmed_at_to_followers.rb | db/migrate/20171218105118_add_column_confirmed_at_to_followers.rb | # frozen_string_literal: true
class AddColumnConfirmedAtToFollowers < ActiveRecord::Migration
def change
add_column :followers, :confirmed_at, :datetime
reversible do |direction|
direction.up do
Follower.reset_column_information
Follower.alive.update_all(confirmed_at: Time.current)
end
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150203184911_create_dropbox_files.rb | db/migrate/20150203184911_create_dropbox_files.rb | # frozen_string_literal: true
class CreateDropboxFiles < ActiveRecord::Migration
def change
create_table :dropbox_files do |t|
t.string :state
t.string :dropbox_url
t.datetime :expires_at
t.datetime :deleted_at
t.integer :user_id
t.integer :product_file_id
t.integer :link_id
t.text :json_data
t.string :s3_url
t.timestamps
end
add_index :dropbox_files, :user_id
add_index :dropbox_files, :product_file_id
add_index :dropbox_files, :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/20221107074039_create_offer_codes_products.rb | db/migrate/20221107074039_create_offer_codes_products.rb | # frozen_string_literal: true
class CreateOfferCodesProducts < ActiveRecord::Migration[7.0]
def change
create_table :offer_codes_products do |t|
t.references :offer_code
t.references :product
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/20150429175645_add_verticals_to_user_compliance_info.rb | db/migrate/20150429175645_add_verticals_to_user_compliance_info.rb | # frozen_string_literal: true
class AddVerticalsToUserComplianceInfo < ActiveRecord::Migration
def change
add_column :user_compliance_info, :verticals, :text
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20131205023523_drop_index_on_resource_subscriptions.rb | db/migrate/20131205023523_drop_index_on_resource_subscriptions.rb | # frozen_string_literal: true
class DropIndexOnResourceSubscriptions < ActiveRecord::Migration
def change
remove_index :resource_subscriptions, name: "index_resource_subscriptions_on_user_application_resource_name"
add_index :resource_subscriptions, :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/20191014233812_backfill_installments_events_cache_count.rb | db/migrate/20191014233812_backfill_installments_events_cache_count.rb | # frozen_string_literal: true
class BackfillInstallmentsEventsCacheCount < ActiveRecord::Migration
def up
Installment.find_in_batches do |installments|
# installment_events_count can be zero here instead of precalculated because we know
# the installment_events table is empty.
Installment.where(id: installments.map(&:id)).update_all(installment_events_count: 0)
sleep(0.01)
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231011032248_add_digest_to_product_files_archive.rb | db/migrate/20231011032248_add_digest_to_product_files_archive.rb | # frozen_string_literal: true
class AddDigestToProductFilesArchive < ActiveRecord::Migration[7.0]
def change
add_column :product_files_archives, :digest, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230404170250_add_index_on_user_id_updated_at_to_links.rb | db/migrate/20230404170250_add_index_on_user_id_updated_at_to_links.rb | # frozen_string_literal: true
class AddIndexOnUserIdUpdatedAtToLinks < ActiveRecord::Migration[7.0]
def change
add_index :links, [:user_id, :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/20190601144310_back_fill_refunds.rb | db/migrate/20190601144310_back_fill_refunds.rb | # frozen_string_literal: true
class BackFillRefunds < ActiveRecord::Migration
def up
change_column_default :refunds, :status, "succeeded"
Refund.find_each do |refund|
refund.status = "succeeded"
refund.save!
end
end
def down
# NOOP
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130717181612_add_tax_cents_to_purchases.rb | db/migrate/20130717181612_add_tax_cents_to_purchases.rb | # frozen_string_literal: true
class AddTaxCentsToPurchases < ActiveRecord::Migration
def up
add_column :purchases, :tax_cents, :integer, default: 0
end
def down
remove_column :purchases, :tax_cents
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240206111225_create_purchase_custom_fields.rb | db/migrate/20240206111225_create_purchase_custom_fields.rb | # frozen_string_literal: true
class CreatePurchaseCustomFields < ActiveRecord::Migration[7.0]
def change
create_table :purchase_custom_fields do |t|
t.belongs_to :purchase, null: false
t.string :field_type, null: false
t.string :name, null: false
t.text :value
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/20200830200804_add_base_tier_price_to_prices.rb | db/migrate/20200830200804_add_base_tier_price_to_prices.rb | # frozen_string_literal: true
class AddBaseTierPriceToPrices < ActiveRecord::Migration[5.1]
# TODO(helen): remove this column when confident that tiered pricing data
# migration was successful (see https://github.com/gumroad/web/pull/13830)
def up
add_column :prices, :base_tier_price, :boolean
end
def down
remove_column :prices, :base_tier_price
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130109002248_add_installment_id_to_url_redirects.rb | db/migrate/20130109002248_add_installment_id_to_url_redirects.rb | # frozen_string_literal: true
class AddInstallmentIdToUrlRedirects < ActiveRecord::Migration
def change
add_column :url_redirects, :installment_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/20120912185136_change_cvc_check_to_cvc_check_failed.rb | db/migrate/20120912185136_change_cvc_check_to_cvc_check_failed.rb | # frozen_string_literal: true
class ChangeCvcCheckToCvcCheckFailed < ActiveRecord::Migration
def up
rename_column(:credit_cards, :cvc_check, :cvc_check_failed)
end
def down
rename_column(:credit_cards, :cvc_check_failed, :cvc_check)
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231119190051_drop_megaphone_states.rb | db/migrate/20231119190051_drop_megaphone_states.rb | # frozen_string_literal: true
class DropMegaphoneStates < ActiveRecord::Migration[7.0]
def up
drop_table :megaphone_states
end
def down
create_table "megaphone_states", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci" do |t|
t.integer "user_id"
t.bigint "flags", default: 0, null: false
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.index ["user_id"], name: "index_megaphone_states_on_user_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/20191101194142_drop_user_underwriting.rb | db/migrate/20191101194142_drop_user_underwriting.rb | # frozen_string_literal: true
class DropUserUnderwriting < ActiveRecord::Migration
def up
drop_table :user_underwriting
end
def down
create_table "user_underwriting" do |t|
t.integer "user_id", limit: 4
t.integer "user_compliance_info_id", limit: 4
t.integer "bank_account_id", limit: 4
t.integer "queued_by_admin_user_id", limit: 4
t.integer "approved_by_admin_user_id", limit: 4
t.string "from_relationship", limit: 255
t.string "to_relationship", limit: 255
t.string "underwriting_state", limit: 255
t.string "submission_group_id", limit: 255
t.datetime "created_at"
t.datetime "updated_at"
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"], name: "index_user_underwriting_on_user_id", using: :btree
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130125190448_add_charitable_to_products.rb | db/migrate/20130125190448_add_charitable_to_products.rb | # frozen_string_literal: true
class AddCharitableToProducts < ActiveRecord::Migration
def change
add_column :links, :is_charitable, :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/20150729324908_add_link_id_to_consumption_events.rb | db/migrate/20150729324908_add_link_id_to_consumption_events.rb | # frozen_string_literal: true
class AddLinkIdToConsumptionEvents < ActiveRecord::Migration
def change
add_column :consumption_events, :link_id, :integer
add_index :consumption_events, :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/20230629014321_add_minimum_amount_cents_to_offer_codes.rb | db/migrate/20230629014321_add_minimum_amount_cents_to_offer_codes.rb | # frozen_string_literal: true
class AddMinimumAmountCentsToOfferCodes < ActiveRecord::Migration[7.0]
def change
change_table :offer_codes, bulk: true do |t|
t.integer :minimum_amount_cents
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220726011222_add_rated_as_adult_to_products_index.rb | db/migrate/20220726011222_add_rated_as_adult_to_products_index.rb | # frozen_string_literal: true
class AddRatedAsAdultToProductsIndex < ActiveRecord::Migration[6.1]
def up
EsClient.indices.put_mapping(
index: Link.index_name,
body: {
properties: {
rated_as_adult: { type: "boolean" }
}
}
)
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20251121152058_add_offer_codes_to_products_index.rb | db/migrate/20251121152058_add_offer_codes_to_products_index.rb | # frozen_string_literal: true
class AddOfferCodesToProductsIndex < ActiveRecord::Migration[7.1]
def up
EsClient.indices.put_mapping(
index: Link.index_name,
body: {
properties: {
offer_codes: {
type: "text",
fields: {
code: {
type: "keyword",
ignore_above: 256
}
}
}
}
}
)
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130618031038_add_user_risk_state_to_users.rb | db/migrate/20130618031038_add_user_risk_state_to_users.rb | # frozen_string_literal: true
class AddUserRiskStateToUsers < ActiveRecord::Migration
def up
add_column :users, :user_risk_state, :string
end
def down
remove_column :users, :user_risk_state
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140807201229_create_invites.rb | db/migrate/20140807201229_create_invites.rb | # frozen_string_literal: true
class CreateInvites < ActiveRecord::Migration
def change
create_table :invites do |t|
t.integer :sender_id
t.string :receiver_email
t.integer :receiver_id
t.string :invite_state
t.timestamps
end
add_index :invites, [:sender_id]
add_index :invites, [:receiver_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/20210819034447_add_purchaser_to_purchase_index.rb | db/migrate/20210819034447_add_purchaser_to_purchase_index.rb | # frozen_string_literal: true
class AddPurchaserToPurchaseIndex < ActiveRecord::Migration[6.1]
def up
EsClient.indices.put_mapping(
index: Purchase.index_name,
body: {
properties: {
purchaser: {
type: :nested,
properties: {
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/20131016074628_add_json_data_to_installments.rb | db/migrate/20131016074628_add_json_data_to_installments.rb | # frozen_string_literal: true
class AddJsonDataToInstallments < ActiveRecord::Migration
def change
add_column :installments, :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/20130607185059_remove_index_from_offer_codes.rb | db/migrate/20130607185059_remove_index_from_offer_codes.rb | # frozen_string_literal: true
class RemoveIndexFromOfferCodes < ActiveRecord::Migration
def change
remove_index :offer_codes, name: "index_offer_codes_on_link_id_and_name"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210728154434_create_confirmed_follower_events_index.rb | db/migrate/20210728154434_create_confirmed_follower_events_index.rb | # frozen_string_literal: true
class CreateConfirmedFollowerEventsIndex < ActiveRecord::Migration[6.1]
def up
if Rails.env.production? || Rails.env.staging?
ConfirmedFollowerEvent.__elasticsearch__.create_index!(index: "confirmed_follower_events_v1")
EsClient.indices.put_alias(name: "confirmed_follower_events", index: "confirmed_follower_events_v1")
else
ConfirmedFollowerEvent.__elasticsearch__.create_index!
end
end
def down
if Rails.env.production? || Rails.env.staging?
EsClient.indices.delete_alias(name: "confirmed_follower_events", index: "confirmed_follower_events_v1")
ConfirmedFollowerEvent.__elasticsearch__.delete_index!(index: "confirmed_follower_events_v1")
else
ConfirmedFollowerEvent.__elasticsearch__.delete_index!
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121003035320_add_shown_on_profile_index_to_links.rb | db/migrate/20121003035320_add_shown_on_profile_index_to_links.rb | # frozen_string_literal: true
class AddShownOnProfileIndexToLinks < ActiveRecord::Migration
def change
add_index :links, :shown_on_profile
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20141120190256_add_facebook_and_image_conversion_tracking_to_users.rb | db/migrate/20141120190256_add_facebook_and_image_conversion_tracking_to_users.rb | # frozen_string_literal: true
class AddFacebookAndImageConversionTrackingToUsers < ActiveRecord::Migration
def change
add_column :users, :conversion_tracking_facebook_id, :string
add_column :users, :conversion_tracking_image_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/20130719205215_add_flags_to_installments.rb | db/migrate/20130719205215_add_flags_to_installments.rb | # frozen_string_literal: true
class AddFlagsToInstallments < ActiveRecord::Migration
def change
add_column :installments, :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/20131016075111_add_customer_count_to_installments.rb | db/migrate/20131016075111_add_customer_count_to_installments.rb | # frozen_string_literal: true
class AddCustomerCountToInstallments < ActiveRecord::Migration
def change
add_column :installments, :customer_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/20201017221238_add_description_to_product_files.rb | db/migrate/20201017221238_add_description_to_product_files.rb | # frozen_string_literal: true
class AddDescriptionToProductFiles < ActiveRecord::Migration[6.0]
def up
add_column :product_files, :description, :text
end
def down
remove_column :product_files, :description
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240206105114_create_carts.rb | db/migrate/20240206105114_create_carts.rb | # frozen_string_literal: true
class CreateCarts < ActiveRecord::Migration[7.0]
def change
create_table :carts do |t|
t.references :user
t.references :order, index: false
t.string :email, null: false, index: true
t.text :return_url, size: :long
t.json :discount_codes, size: :long
t.boolean :reject_ppp_discount, default: false, null: false
t.datetime :deleted_at
t.timestamps
end
add_index :carts, :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/20140526175953_add_deleted_at_to_imported_customers.rb | db/migrate/20140526175953_add_deleted_at_to_imported_customers.rb | # frozen_string_literal: true
class AddDeletedAtToImportedCustomers < ActiveRecord::Migration
def change
add_column :imported_customers, :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/20120504222635_add_partner_source_to_links.rb | db/migrate/20120504222635_add_partner_source_to_links.rb | # frozen_string_literal: true
class AddPartnerSourceToLinks < ActiveRecord::Migration
def change
add_column :links, :partner_source, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20181126172157_add_index_for_user_id_in_events.rb | db/migrate/20181126172157_add_index_for_user_id_in_events.rb | # frozen_string_literal: true
class AddIndexForUserIdInEvents < ActiveRecord::Migration
def change
add_index :events, :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/20200618215815_fix_index_on_devices.rb | db/migrate/20200618215815_fix_index_on_devices.rb | # frozen_string_literal: true
class FixIndexOnDevices < ActiveRecord::Migration
def up
remove_index :devices, column: :token
add_index :devices, [:token, :device_type], unique: true
end
def down
remove_index :devices, [:token, :device_type]
add_index :devices, :token, 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/20120225190810_create_infos.rb | db/migrate/20120225190810_create_infos.rb | # frozen_string_literal: true
class CreateInfos < ActiveRecord::Migration
def change
create_table :infos do |t|
t.string :type
t.integer :size
t.integer :duration
t.integer :bitrate
t.integer :framerate
t.string :resolution
t.integer :pagelength
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/20231128094242_change_payment_amount_cents_to_bigint.rb | db/migrate/20231128094242_change_payment_amount_cents_to_bigint.rb | # frozen_string_literal: true
class ChangePaymentAmountCentsToBigint < ActiveRecord::Migration[7.0]
def up
change_column :payments, :amount_cents, :bigint
end
def down
change_column :payments, :amount_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/20140715225046_add_source_type_to_daily_metrics.rb | db/migrate/20140715225046_add_source_type_to_daily_metrics.rb | # frozen_string_literal: true
class AddSourceTypeToDailyMetrics < ActiveRecord::Migration
def change
add_column :daily_metrics, :source_type, :string, default: "all"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130628203022_create_gifts.rb | db/migrate/20130628203022_create_gifts.rb | # frozen_string_literal: true
class CreateGifts < ActiveRecord::Migration
def change
create_table :gifts do |t|
t.integer :giftee_purchase_id
t.integer :gifter_purchase_id
t.integer :link_id
t.string :state
t.string :gift_note
t.string :giftee_email
t.string :gifter_email
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/20241021212931_remove_null_constraint_from_selected_product_id_upsell_purchases.rb | db/migrate/20241021212931_remove_null_constraint_from_selected_product_id_upsell_purchases.rb | # frozen_string_literal: true
class RemoveNullConstraintFromSelectedProductIdUpsellPurchases < ActiveRecord::Migration[7.1]
def change
change_column_null :upsell_purchases, :selected_product_id, true
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150810000000_add_processor_fee_cents_currency_to_purchases.rb | db/migrate/20150810000000_add_processor_fee_cents_currency_to_purchases.rb | # frozen_string_literal: true
class AddProcessorFeeCentsCurrencyToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :processor_fee_cents_currency, :string, default: "usd"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120921000018_add_some_new_fields_to_payments.rb | db/migrate/20120921000018_add_some_new_fields_to_payments.rb | # frozen_string_literal: true
class AddSomeNewFieldsToPayments < ActiveRecord::Migration
def change
add_column :payments, :txn_id, :string
add_column :payments, :unique_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/20190725194234_add_index_for_users_payment_address.rb | db/migrate/20190725194234_add_index_for_users_payment_address.rb | # frozen_string_literal: true
class AddIndexForUsersPaymentAddress < ActiveRecord::Migration
def up
add_index :users, [:payment_address, :user_risk_state]
end
def down
remove_index :users, [:payment_address, :user_risk_state]
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210224145735_remove_fanpage_from_users.rb | db/migrate/20210224145735_remove_fanpage_from_users.rb | # frozen_string_literal: true
class RemoveFanpageFromUsers < ActiveRecord::Migration[6.1]
def change
remove_column :users, :fanpage, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120702195405_create_blocked_ips.rb | db/migrate/20120702195405_create_blocked_ips.rb | # frozen_string_literal: true
class CreateBlockedIps < ActiveRecord::Migration
def change
create_table :blocked_ips do |t|
t.string :ip_address
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/20150623224847_add_destination_url_to_affiliates.rb | db/migrate/20150623224847_add_destination_url_to_affiliates.rb | # frozen_string_literal: true
class AddDestinationUrlToAffiliates < ActiveRecord::Migration
def change
add_column :affiliates, :destination_url, :string, limit: 2083
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230828063848_remove_integration_type_from_integration.rb | db/migrate/20230828063848_remove_integration_type_from_integration.rb | # frozen_string_literal: true
class RemoveIntegrationTypeFromIntegration < ActiveRecord::Migration[7.0]
def up
remove_column :integrations, :integration_type
end
def down
add_column :integrations, :integration_type, :string
[CircleIntegration, DiscordIntegration, GoogleCalendarIntegration, ZoomIntegration].each do |klass|
klass.reset_column_information
end
CircleIntegration.in_batches do |relation|
ReplicaLagWatcher.watch
relation.update_all(integration_type: "circle")
end
DiscordIntegration.in_batches do |relation|
ReplicaLagWatcher.watch
relation.update_all(integration_type: "discord")
end
GoogleCalendarIntegration.in_batches do |relation|
ReplicaLagWatcher.watch
relation.update_all(integration_type: "google_calendar")
end
ZoomIntegration.in_batches do |relation|
ReplicaLagWatcher.watch
relation.update_all(integration_type: "zoom")
end
change_column_null :integrations, :integration_type, false
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240816035957_add_index_on_product_files_url.rb | db/migrate/20240816035957_add_index_on_product_files_url.rb | # frozen_string_literal: true
class AddIndexOnProductFilesUrl < ActiveRecord::Migration[7.1]
def change
add_index :product_files, :url
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120605011017_remove_fb_timezone_and_locale_from_users.rb | db/migrate/20120605011017_remove_fb_timezone_and_locale_from_users.rb | # frozen_string_literal: true
class RemoveFbTimezoneAndLocaleFromUsers < ActiveRecord::Migration
def up
remove_column :users, :facebook_timezone
remove_column :users, :facebook_locale
end
def down
add_column :users, :facebook_timezone, :string
add_column :users, :facebook_locale, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140718003800_create_documents.rb | db/migrate/20140718003800_create_documents.rb | # frozen_string_literal: true
class CreateDocuments < ActiveRecord::Migration
def change
create_table :documents do |t|
t.belongs_to :product_file
t.string :state
t.string :external_docspad_id
t.timestamps
end
add_index :documents, :external_docspad_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20170222073047_remove_oauth_authorizations.rb | db/migrate/20170222073047_remove_oauth_authorizations.rb | # frozen_string_literal: true
class RemoveOauthAuthorizations < ActiveRecord::Migration
def change
drop_table :oauth_authorizations
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120921190155_add_card_visual_to_purchases.rb | db/migrate/20120921190155_add_card_visual_to_purchases.rb | # frozen_string_literal: true
class AddCardVisualToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :card_visual, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210413120934_change_transcoded_videos_original_video_key_limit.rb | db/migrate/20210413120934_change_transcoded_videos_original_video_key_limit.rb | # frozen_string_literal: true
class ChangeTranscodedVideosOriginalVideoKeyLimit < ActiveRecord::Migration[6.1]
def up
change_column :transcoded_videos, :original_video_key, :string, limit: 1024
end
def down
change_column :transcoded_videos, :original_video_key, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121115040149_add_price_cents_index_to_purchases.rb | db/migrate/20121115040149_add_price_cents_index_to_purchases.rb | # frozen_string_literal: true
class AddPriceCentsIndexToPurchases < ActiveRecord::Migration
def up
add_index "purchases", ["price_cents"]
end
def down
remove_index "purchases", ["price_cents"]
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121115185246_add_purchaser_id_index_to_purchases.rb | db/migrate/20121115185246_add_purchaser_id_index_to_purchases.rb | # frozen_string_literal: true
class AddPurchaserIdIndexToPurchases < ActiveRecord::Migration
def up
add_index "purchases", "purchaser_id"
end
def down
remove_index "purchases", "purchaser_id"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20181218072620_add_deleted_from_cdn_at_to_product_files.rb | db/migrate/20181218072620_add_deleted_from_cdn_at_to_product_files.rb | # frozen_string_literal: true
class AddDeletedFromCdnAtToProductFiles < ActiveRecord::Migration
def change
add_column :product_files, :deleted_from_cdn_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/20181009184808_create_new_categories.rb | db/migrate/20181009184808_create_new_categories.rb | # frozen_string_literal: true
class CreateNewCategories < ActiveRecord::Migration
CATEGORY_NAMES = %w(comics drawing animation audio games photography comedy crafts food design dance sports)
def up
CATEGORY_NAMES.each do |category_name|
category = Category.new
category.name = category_name
category.save!
end
end
def down
CATEGORY_NAMES.each do |category_name|
Category.where(name: category_name).destroy_all
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20251003165816_add_isbn_to_product_files.rb | db/migrate/20251003165816_add_isbn_to_product_files.rb | # frozen_string_literal: true
class AddIsbnToProductFiles < ActiveRecord::Migration[7.1]
def change
add_column :product_files, :isbn, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140320192121_change_default_max_purchase_count_on_links.rb | db/migrate/20140320192121_change_default_max_purchase_count_on_links.rb | # frozen_string_literal: true
class ChangeDefaultMaxPurchaseCountOnLinks < ActiveRecord::Migration
def up
change_column :links, :max_purchase_count, :integer, default: nil
end
def down
change_column :links, :max_purchase_count, :integer, default: 999999
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151030170023_remove_old_product_tags.rb | db/migrate/20151030170023_remove_old_product_tags.rb | # frozen_string_literal: true
class RemoveOldProductTags < ActiveRecord::Migration
def change
drop_table :product_tags
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20201024165507_add_versions_object_changes.rb | db/migrate/20201024165507_add_versions_object_changes.rb | # frozen_string_literal: true
class AddVersionsObjectChanges < ActiveRecord::Migration[6.0]
def change
add_column :versions, :object_changes, :text, size: :long
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240626160241_create_calls.rb | db/migrate/20240626160241_create_calls.rb | # frozen_string_literal: true
class CreateCalls < ActiveRecord::Migration[7.1]
def change
create_table :calls do |t|
t.references :purchase
t.string :call_url, limit: 1024
t.datetime :start_time
t.datetime :end_time
t.timestamps
end
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.