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/20130218211025_create_offer_codes.rb | db/migrate/20130218211025_create_offer_codes.rb | # frozen_string_literal: true
class CreateOfferCodes < ActiveRecord::Migration
def change
create_table :offer_codes do |t|
t.references :link
t.string :name
t.integer :amount_cents
t.integer :max_purchase_count
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/20210910115450_add_interruption_timestamps_to_subscriptions.rb | db/migrate/20210910115450_add_interruption_timestamps_to_subscriptions.rb | # frozen_string_literal: true
class AddInterruptionTimestampsToSubscriptions < ActiveRecord::Migration[6.1]
def change
change_table :subscriptions, bulk: true do |t|
t.datetime :last_resubscribed_at, null: true
t.datetime :last_deactivated_at, null: 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/20121029235025_add_twitter_ouath_token_to_users.rb | db/migrate/20121029235025_add_twitter_ouath_token_to_users.rb | # frozen_string_literal: true
class AddTwitterOuathTokenToUsers < ActiveRecord::Migration
def change
add_column :users, :twitter_oauth_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/20240609161156_add_recent_sales_count_to_taxonomy_stats.rb | db/migrate/20240609161156_add_recent_sales_count_to_taxonomy_stats.rb | # frozen_string_literal: true
#
class AddRecentSalesCountToTaxonomyStats < ActiveRecord::Migration[7.1]
def change
add_column :taxonomy_stats, :recent_sales_count, :int, 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/20230404185041_remove_messages.rb | db/migrate/20230404185041_remove_messages.rb | # frozen_string_literal: true
class RemoveMessages < ActiveRecord::Migration[7.0]
def up
drop_table :messages
end
def down
create_table "messages", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci" do |t|
t.integer "parent_id"
t.integer "purchase_id"
t.integer "flags", ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231219083048_create_charges.rb | db/migrate/20231219083048_create_charges.rb | # frozen_string_literal: true
class CreateCharges < ActiveRecord::Migration[7.0]
def change
create_table :charges do |t|
t.references :order, null: false
t.references :seller, null: false
t.string :processor, null: false
t.string :processor_transaction_id, index: { unique: true }
t.... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121004175839_add_external_css_url_to_users.rb | db/migrate/20121004175839_add_external_css_url_to_users.rb | # frozen_string_literal: true
class AddExternalCssUrlToUsers < ActiveRecord::Migration
def change
add_column :users, :external_css_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/20150128162110_add_gumroad_tax_cents_to_purchase.rb | db/migrate/20150128162110_add_gumroad_tax_cents_to_purchase.rb | # frozen_string_literal: true
class AddGumroadTaxCentsToPurchase < ActiveRecord::Migration
def change
add_column :purchases, :gumroad_tax_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/20220626140322_create_sent_post_emails.rb | db/migrate/20220626140322_create_sent_post_emails.rb | # frozen_string_literal: true
class CreateSentPostEmails < ActiveRecord::Migration[6.1]
def change
create_table :sent_post_emails do |t|
t.bigint :post_id, null: false
t.string :email, null: false
t.timestamps
t.index [:post_id, :email], 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/20250103145344_add_deleted_at_and_disabled_at_to_utm_links.rb | db/migrate/20250103145344_add_deleted_at_and_disabled_at_to_utm_links.rb | # frozen_string_literal: true
class AddDeletedAtAndDisabledAtToUtmLinks < ActiveRecord::Migration[7.1]
def change
change_table :utm_links, bulk: true do |t|
t.datetime :deleted_at, precision: nil, index: true
t.datetime :disabled_at, precision: nil
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120917232121_update_credit_cards_stripe_fingerprint_index.rb | db/migrate/20120917232121_update_credit_cards_stripe_fingerprint_index.rb | # frozen_string_literal: true
class UpdateCreditCardsStripeFingerprintIndex < ActiveRecord::Migration
def up
remove_index :credit_cards, name: "index_credit_cards_on_stripe_fingerprint"
add_index :credit_cards, [:stripe_fingerprint], unique: true, name: "index_credit_cards_on_stripe_fingerprint_unique"
end... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230227210525_create_user_recommended_root_taxonomies.rb | db/migrate/20230227210525_create_user_recommended_root_taxonomies.rb | # frozen_string_literal: true
class CreateUserRecommendedRootTaxonomies < ActiveRecord::Migration[7.0]
def change
create_table :user_recommended_root_taxonomies do |t|
t.references :user, null: false, index: false
t.references :taxonomy, null: false, index: false
t.integer :position, null: fals... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140822200030_add_position_to_product_files.rb | db/migrate/20140822200030_add_position_to_product_files.rb | # frozen_string_literal: true
class AddPositionToProductFiles < ActiveRecord::Migration
def change
add_column :product_files, :position, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140902220133_add_link_id_index_to_base_variants.rb | db/migrate/20140902220133_add_link_id_index_to_base_variants.rb | # frozen_string_literal: true
class AddLinkIdIndexToBaseVariants < ActiveRecord::Migration
def change
add_index :base_variants, :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/20130219215825_add_locale_to_users.rb | db/migrate/20130219215825_add_locale_to_users.rb | # frozen_string_literal: true
class AddLocaleToUsers < ActiveRecord::Migration
def change
add_column :users, :locale, :string, default: "en"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210121062551_add_missing_indexes_to_user.rb | db/migrate/20210121062551_add_missing_indexes_to_user.rb | # frozen_string_literal: true
class AddMissingIndexesToUser < ActiveRecord::Migration[6.0]
def change
change_table :users do |t|
t.index :current_sign_in_ip
t.index :last_sign_in_ip
t.index :account_created_ip
t.index :user_risk_state
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220415204825_add_top_seller_requests_index.rb | db/migrate/20220415204825_add_top_seller_requests_index.rb | # frozen_string_literal: true
class AddTopSellerRequestsIndex < ActiveRecord::Migration[6.1]
def up
if Rails.env.production? || Rails.env.staging?
TopSellerRequest.__elasticsearch__.create_index!(index: "top_seller_requests_v1")
EsClient.indices.put_alias(name: "top_seller_requests", index: "top_sell... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230125154851_create_upsells_products.rb | db/migrate/20230125154851_create_upsells_products.rb | # frozen_string_literal: true
class CreateUpsellsProducts < ActiveRecord::Migration[7.0]
def change
create_table :upsells_products do |t|
t.references :upsell, null: false
t.references :product, 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/20121115033310_remove_session_id_as_index_on_purchases.rb | db/migrate/20121115033310_remove_session_id_as_index_on_purchases.rb | # frozen_string_literal: true
class RemoveSessionIdAsIndexOnPurchases < ActiveRecord::Migration
def up
remove_index :purchases, :session_id
end
def down
add_index :purchases, :session_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210106035128_add_missing_indices_to_purchases.rb | db/migrate/20210106035128_add_missing_indices_to_purchases.rb | # frozen_string_literal: true
class AddMissingIndicesToPurchases < ActiveRecord::Migration[6.0]
def up
execute <<~SQL
ALTER TABLE purchases CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
add index index_purchases_on_seller_id_and_succeeded_at (seller_id, succeeded_at),
add index index_purcha... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20200525223103_add_position_to_base_variants.rb | db/migrate/20200525223103_add_position_to_base_variants.rb | # frozen_string_literal: true
class AddPositionToBaseVariants < ActiveRecord::Migration
def change
add_column :base_variants, :position_in_category, :integer
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240730154256_add_call_start_time_to_cart_products.rb | db/migrate/20240730154256_add_call_start_time_to_cart_products.rb | # frozen_string_literal: true
class AddCallStartTimeToCartProducts < ActiveRecord::Migration[7.1]
def change
add_column :cart_products, :call_start_time, :datetime
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20200927050534_sync_tables_default_charsets.rb | db/migrate/20200927050534_sync_tables_default_charsets.rb | # frozen_string_literal: true
class SyncTablesDefaultCharsets < ActiveRecord::Migration[6.0]
def up
table_changes = {
"affiliate_credits" => "CHARACTER SET latin1",
"affiliate_partial_refunds" => "CHARACTER SET latin1",
"affiliates" => "CHARACTER SET utf8 COLLATE utf8_unicode_ci",
"affili... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120420214602_drop_receipts_table.rb | db/migrate/20120420214602_drop_receipts_table.rb | # frozen_string_literal: true
class DropReceiptsTable < ActiveRecord::Migration
def up
drop_table :receipts
end
def down
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150818073723_add_duration_to_link_and_occurence_to_subscription.rb | db/migrate/20150818073723_add_duration_to_link_and_occurence_to_subscription.rb | # frozen_string_literal: true
class AddDurationToLinkAndOccurenceToSubscription < ActiveRecord::Migration
def change
add_column :links, :duration_in_months, :integer
add_column :subscriptions, :charge_occurrence_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/20190427212700_remove_unused_tables.rb | db/migrate/20190427212700_remove_unused_tables.rb | # frozen_string_literal: true
class RemoveUnusedTables < ActiveRecord::Migration
def up
drop_table :ab_tests
drop_table :api_sessions
drop_table :assignments
drop_table :audit_tasks
drop_table :blocked_browser_guids
drop_table :daily_metrics
drop_table :purchase_codes
drop_table :sxsw... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20211222010343_create_sales_export_chunks.rb | db/migrate/20211222010343_create_sales_export_chunks.rb | # frozen_string_literal: true
class CreateSalesExportChunks < ActiveRecord::Migration[6.1]
def change
create_table :sales_export_chunks do |t|
t.bigint :export_id, null: false, index: true
t.longtext :purchase_ids
t.text :custom_fields
t.longtext :purchases_data
t.boolean :processed... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111201183301_disabled_at.rb | db/migrate/20111201183301_disabled_at.rb | # frozen_string_literal: true
class DisabledAt < ActiveRecord::Migration
def up
add_column :links, :purchase_disabled_at, :datetime
end
def down
remove_column :links, :purchase_disabled_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/20210609090425_drop_blocked_ip.rb | db/migrate/20210609090425_drop_blocked_ip.rb | # frozen_string_literal: true
class DropBlockedIp < ActiveRecord::Migration[6.1]
def up
drop_table :blocked_ips
end
def down
create_table "blocked_ips", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.string "ip_address"
t.datetime "created_at"
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150402215254_add_tracking_number_and_carrier_to_shipment.rb | db/migrate/20150402215254_add_tracking_number_and_carrier_to_shipment.rb | # frozen_string_literal: true
class AddTrackingNumberAndCarrierToShipment < ActiveRecord::Migration
def change
add_column :shipments, :tracking_number, :string
add_column :shipments, :carrier, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111206214227_user_verification.rb | db/migrate/20111206214227_user_verification.rb | # frozen_string_literal: true
class UserVerification < ActiveRecord::Migration
def up
add_column :users, :email_verified_at, :datetime
end
def down
remove_column :users, :email_verified_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/20211213122919_add_asset_previews_index_to_deleted_at.rb | db/migrate/20211213122919_add_asset_previews_index_to_deleted_at.rb | # frozen_string_literal: true
class AddAssetPreviewsIndexToDeletedAt < ActiveRecord::Migration[6.1]
def up
change_table :asset_previews, bulk: true do |t|
t.change :id, :bigint, null: false, unique: true, auto_increment: true
t.change :link_id, :bigint
t.index :deleted_at
end
end
def d... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150709201644_create_custom_domains.rb | db/migrate/20150709201644_create_custom_domains.rb | # frozen_string_literal: true
class CreateCustomDomains < ActiveRecord::Migration
def change
create_table :custom_domains, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.references :user
t.string :domain
t.string :type
t.timestamps
end
add_index :custom_d... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150909000000_create_disputes.rb | db/migrate/20150909000000_create_disputes.rb | # frozen_string_literal: true
class CreateDisputes < ActiveRecord::Migration
def change
create_table :disputes, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.references :purchase
t.string :charge_processor_id
t.string :charge_processor_dispute_id
t.string :reason
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20190715141316_add_vat_id_to_purchase_sales_tax_infos.rb | db/migrate/20190715141316_add_vat_id_to_purchase_sales_tax_infos.rb | # frozen_string_literal: true
class AddVatIdToPurchaseSalesTaxInfos < ActiveRecord::Migration
def change
add_column :purchase_sales_tax_infos, :business_vat_id, :string, default: nil, 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/20220608012107_remove_links_index_purchase_disabled_at.rb | db/migrate/20220608012107_remove_links_index_purchase_disabled_at.rb | # frozen_string_literal: true
class RemoveLinksIndexPurchaseDisabledAt < ActiveRecord::Migration[6.1]
def up
remove_index :links, :purchase_disabled_at
end
def down
add_index :links, :purchase_disabled_at
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130625001834_create_dynamic_product_page_switch_assignments.rb | db/migrate/20130625001834_create_dynamic_product_page_switch_assignments.rb | # frozen_string_literal: true
class CreateDynamicProductPageSwitchAssignments < ActiveRecord::Migration
def change
create_table :dynamic_product_page_switch_assignments do |t|
t.references :link
t.references :dynamic_product_page_switch
t.integer :switch_value
t.datetime :deleted_at
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240206135412_create_cart_products.rb | db/migrate/20240206135412_create_cart_products.rb | # frozen_string_literal: true
class CreateCartProducts < ActiveRecord::Migration[7.0]
def change
create_table :cart_products do |t|
t.references :cart, null: false
t.references :product, null: false
t.references :option, index: false
t.references :affiliate, index: false
t.reference... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240408073222_make_charge_processor_and_merchant_account_id_nullable.rb | db/migrate/20240408073222_make_charge_processor_and_merchant_account_id_nullable.rb | # frozen_string_literal: true
class MakeChargeProcessorAndMerchantAccountIdNullable < ActiveRecord::Migration[7.1]
def up
change_table :charges, bulk: true do |t|
t.change :processor, :string, null: true
t.change :merchant_account_id, :bigint, null: true
end
end
def down
change_table :ch... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150520200000_add_merchant_id_to_balances.rb | db/migrate/20150520200000_add_merchant_id_to_balances.rb | # frozen_string_literal: true
class AddMerchantIdToBalances < ActiveRecord::Migration
def up
add_column :balances, :merchant_account_id, :integer, default: MerchantAccount.gumroad(StripeChargeProcessor.charge_processor_id).id
add_index :balances, [:user_id, :merchant_account_id, :date], unique: true
remo... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150805170243_create_base_variants_product_files_join_table.rb | db/migrate/20150805170243_create_base_variants_product_files_join_table.rb | # frozen_string_literal: true
class CreateBaseVariantsProductFilesJoinTable < ActiveRecord::Migration
def change
create_table :base_variants_product_files do |t|
t.references :base_variant
t.references :product_file
end
add_index :base_variants_product_files, :base_variant_id
add_index :... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121018221916_add_browser_fingerprint_to_events_and_visits.rb | db/migrate/20121018221916_add_browser_fingerprint_to_events_and_visits.rb | # frozen_string_literal: true
class AddBrowserFingerprintToEventsAndVisits < ActiveRecord::Migration
def up
add_column :events, :browser_fingerprint, :string
add_column :visits, :browser_fingerprint, :string
end
def down
remove_column :events, :browser_fingerprint
remove_column :visits, :browser... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210405195451_add_free_trial_ends_at_to_subscriptions.rb | db/migrate/20210405195451_add_free_trial_ends_at_to_subscriptions.rb | # frozen_string_literal: true
class AddFreeTrialEndsAtToSubscriptions < ActiveRecord::Migration[6.1]
def change
add_column :subscriptions, :free_trial_ends_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/20131204033717_remove_name_index_from_oauth_applications.rb | db/migrate/20131204033717_remove_name_index_from_oauth_applications.rb | # frozen_string_literal: true
class RemoveNameIndexFromOauthApplications < ActiveRecord::Migration
def up
remove_index :oauth_applications, :name
end
def down
add_index :oauth_applications, :name, 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/20150709181910_fix_processed_audio_charset.rb | db/migrate/20150709181910_fix_processed_audio_charset.rb | # frozen_string_literal: true
class FixProcessedAudioCharset < ActiveRecord::Migration
def change
execute("ALTER TABLE processed_audios CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;")
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230517152234_remove_users_recommendation_type_default.rb | db/migrate/20230517152234_remove_users_recommendation_type_default.rb | # frozen_string_literal: true
class RemoveUsersRecommendationTypeDefault < ActiveRecord::Migration[7.0]
def up
Alterity.disable do
change_column_default :users, :recommendation_type, nil
end
end
def down
Alterity.disable do
change_column_default :users, :recommendation_type, "same_creato... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210723170128_create_media_location.rb | db/migrate/20210723170128_create_media_location.rb | # frozen_string_literal: true
class CreateMediaLocation < ActiveRecord::Migration[6.1]
def change
create_table :media_locations do |t|
t.integer :product_file_id, null: false
t.integer :url_redirect_id, null: false
t.integer :purchase_id, null: false
t.integer :link_id, null: false
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20181026094910_add_search_indexes.rb | db/migrate/20181026094910_add_search_indexes.rb | # frozen_string_literal: true
class AddSearchIndexes < ActiveRecord::Migration
def change
add_index :users, :name
add_index :gifts, :giftee_email
add_index :purchases, :full_name
add_index :subscriptions, :cancelled_at
add_index :subscriptions, :failed_at
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111118195144_add_guid_to_attachment.rb | db/migrate/20111118195144_add_guid_to_attachment.rb | # frozen_string_literal: true
class AddGuidToAttachment < ActiveRecord::Migration
def change
add_column :attachments, :file_guid, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20131023021154_create_affiliate_credits.rb | db/migrate/20131023021154_create_affiliate_credits.rb | # frozen_string_literal: true
class CreateAffiliateCredits < ActiveRecord::Migration
def change
create_table :affiliate_credits do |t|
t.references :oauth_application
t.integer :basis_points
t.integer :amount_cents
t.integer :oauth_application_owner_id
t.integer :seller_id
t.i... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210225132913_add_otp_secret_key_to_users.rb | db/migrate/20210225132913_add_otp_secret_key_to_users.rb | # frozen_string_literal: true
class AddOtpSecretKeyToUsers < ActiveRecord::Migration[6.1]
def change
add_column :users, :otp_secret_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/20240615052751_add_total_usd_cents_to_product_cached_value.rb | db/migrate/20240615052751_add_total_usd_cents_to_product_cached_value.rb | # frozen_string_literal: true
class AddTotalUsdCentsToProductCachedValue < ActiveRecord::Migration[7.1]
def change
add_column :product_cached_values, :total_usd_cents, :bigint, 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/20120124192926_create_api_sessions.rb | db/migrate/20120124192926_create_api_sessions.rb | # frozen_string_literal: true
class CreateApiSessions < ActiveRecord::Migration
def change
create_table :api_sessions do |t|
t.integer :user_id
t.string :token
t.timestamps
end
add_index :api_sessions, :user_id
add_index :api_sessions, :token
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230616124032_add_audience_members_purchased_variant_ids.rb | db/migrate/20230616124032_add_audience_members_purchased_variant_ids.rb | # frozen_string_literal: true
class AddAudienceMembersPurchasedVariantIds < ActiveRecord::Migration[7.0]
def up
change_table :audience_members, bulk: true do |t|
t.remove_index name: :idx_audience_on_seller_and_purchases_variants_ids
t.index "`seller_id`, (cast(json_extract(`details`,_utf8mb4'$.purch... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240423133545_add_fractional_seconds_to_papertrail_created_at.rb | db/migrate/20240423133545_add_fractional_seconds_to_papertrail_created_at.rb | # frozen_string_literal: true
class AddFractionalSecondsToPapertrailCreatedAt < ActiveRecord::Migration[7.1]
def up
change_column :versions, :created_at, :datetime, limit: 6
end
def down
change_column :versions, :created_at, :datetime, precision: nil
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231021143022_remove_submitted_at_on_dispute_evidences.rb | db/migrate/20231021143022_remove_submitted_at_on_dispute_evidences.rb | # frozen_string_literal: true
class RemoveSubmittedAtOnDisputeEvidences < ActiveRecord::Migration[7.0]
def up
remove_column :dispute_evidences, :submitted_at
end
def down
change_table :dispute_evidences, bulk: true do |t|
t.datetime :submitted_at
t.index :submitted_at
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150812000000_add_is_business_publicly_traded_to_user_compliance_info.rb | db/migrate/20150812000000_add_is_business_publicly_traded_to_user_compliance_info.rb | # frozen_string_literal: true
class AddIsBusinessPubliclyTradedToUserComplianceInfo < ActiveRecord::Migration
def change
add_column :user_compliance_info, :is_business_publicly_traded, :boolean
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230414060233_create_post_email_blasts.rb | db/migrate/20230414060233_create_post_email_blasts.rb | # frozen_string_literal: true
class CreatePostEmailBlasts < ActiveRecord::Migration[7.0]
def change
create_table :post_email_blasts do |t|
t.references :post, null: false, index: false
t.references :seller, null: false, index: false
t.datetime :requested_at, index: true
t.datetime :starte... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120628181932_add_referrer_to_purchases.rb | db/migrate/20120628181932_add_referrer_to_purchases.rb | # frozen_string_literal: true
class AddReferrerToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :referrer, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20241008140243_remove_unique_index_constraint_from_refunds_processor_refund_id.rb | db/migrate/20241008140243_remove_unique_index_constraint_from_refunds_processor_refund_id.rb | # frozen_string_literal: true
class RemoveUniqueIndexConstraintFromRefundsProcessorRefundId < ActiveRecord::Migration[7.1]
def up
change_table :refunds, bulk: true do |t|
t.remove_index :processor_refund_id
t.index :processor_refund_id
end
end
def down
change_table :refunds, bulk: true d... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231025113632_add_first_published_at_to_workflows.rb | db/migrate/20231025113632_add_first_published_at_to_workflows.rb | # frozen_string_literal: true
class AddFirstPublishedAtToWorkflows < ActiveRecord::Migration[7.0]
def change
add_column :workflows, :first_published_at, :datetime, precision: nil
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210605062909_drop_audience_landing_page_view_events.rb | db/migrate/20210605062909_drop_audience_landing_page_view_events.rb | # frozen_string_literal: true
class DropAudienceLandingPageViewEvents < ActiveRecord::Migration[6.1]
def up
drop_table :audience_landing_page_view_events
end
def down
create_table "audience_landing_page_view_events", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.str... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120117000944_add_rate_purchase.rb | db/migrate/20120117000944_add_rate_purchase.rb | # frozen_string_literal: true
class AddRatePurchase < ActiveRecord::Migration
def up
add_column :purchases, :rate_converted_to_usd, :string
end
def down
remove_column :purchases, :rate_converted_to_usd
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120528234055_add_country_to_users.rb | db/migrate/20120528234055_add_country_to_users.rb | # frozen_string_literal: true
class AddCountryToUsers < ActiveRecord::Migration
def change
add_column :users, :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/20220223153011_add_unsplash_url_to_thumbnail.rb | db/migrate/20220223153011_add_unsplash_url_to_thumbnail.rb | # frozen_string_literal: true
class AddUnsplashUrlToThumbnail < ActiveRecord::Migration[6.1]
def change
add_column :thumbnails, :unsplash_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/20140507034709_add_card_data_handling_to_credit_card.rb | db/migrate/20140507034709_add_card_data_handling_to_credit_card.rb | # frozen_string_literal: true
class AddCardDataHandlingToCreditCard < ActiveRecord::Migration
def change
add_column :credit_cards, :card_data_handling_mode, :string
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210529190819_create_product_folders.rb | db/migrate/20210529190819_create_product_folders.rb | # frozen_string_literal: true
class CreateProductFolders < ActiveRecord::Migration[6.1]
def change
create_table :product_folders do |t|
t.bigint :product_id, index: true
t.string :name
t.integer :position
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/20230706124923_remove_link_id_from_affiliates.rb | db/migrate/20230706124923_remove_link_id_from_affiliates.rb | # frozen_string_literal: true
class RemoveLinkIdFromAffiliates < ActiveRecord::Migration[7.0]
def up
remove_column :affiliates, :link_id
end
def down
change_table :affiliates, bulk: true do |t|
t.bigint :link_id
t.index :link_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/20191006031318_add_installments_events_cache_count.rb | db/migrate/20191006031318_add_installments_events_cache_count.rb | # frozen_string_literal: true
class AddInstallmentsEventsCacheCount < ActiveRecord::Migration
def up
add_column :installments, :installment_events_count, :integer
end
def down
remove_column :installments, :installment_events_count
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20190513150807_remove_flags_from_import_jobs_and_third_party_analytics.rb | db/migrate/20190513150807_remove_flags_from_import_jobs_and_third_party_analytics.rb | # frozen_string_literal: true
class RemoveFlagsFromImportJobsAndThirdPartyAnalytics < ActiveRecord::Migration
def change
remove_column :import_jobs, :flags
remove_column :third_party_analytics, :flags
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231101092721_add_user_compliance_info_requests_index_on_user_id_and_state.rb | db/migrate/20231101092721_add_user_compliance_info_requests_index_on_user_id_and_state.rb | # frozen_string_literal: true
class AddUserComplianceInfoRequestsIndexOnUserIdAndState < ActiveRecord::Migration[7.0]
def change
add_index :user_compliance_info_requests, [:user_id, :state]
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121231043404_add_customized_file_url_to_url_redirects.rb | db/migrate/20121231043404_add_customized_file_url_to_url_redirects.rb | # frozen_string_literal: true
class AddCustomizedFileUrlToUrlRedirects < ActiveRecord::Migration
def change
add_column :url_redirects, :customized_file_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/20230303073007_drop_product_embeddings.rb | db/migrate/20230303073007_drop_product_embeddings.rb | # frozen_string_literal: true
class DropProductEmbeddings < ActiveRecord::Migration[7.0]
def up
drop_table :product_embeddings
end
def down
create_table "product_embeddings", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.bigint "product_id", null: false
t.text... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230411194853_remove_unbannable_from_users.rb | db/migrate/20230411194853_remove_unbannable_from_users.rb | # frozen_string_literal: true
class RemoveUnbannableFromUsers < ActiveRecord::Migration[7.0]
def change
remove_column :users, :unbannable, :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/20190112220320_add_deleted_from_cdn_at_to_product_files_archive.rb | db/migrate/20190112220320_add_deleted_from_cdn_at_to_product_files_archive.rb | # frozen_string_literal: true
class AddDeletedFromCdnAtToProductFilesArchive < ActiveRecord::Migration
def change
add_column :product_files_archives, :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/20130109002305_add_subscription_id_to_url_redirects.rb | db/migrate/20130109002305_add_subscription_id_to_url_redirects.rb | # frozen_string_literal: true
class AddSubscriptionIdToUrlRedirects < ActiveRecord::Migration
def change
add_column :url_redirects, :subscription_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/20120703060331_create_delayed_emails.rb | db/migrate/20120703060331_create_delayed_emails.rb | # frozen_string_literal: true
class CreateDelayedEmails < ActiveRecord::Migration
def change
create_table :delayed_emails do |t|
t.integer :purchase_id
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/20130516174229_add_owner_to_application.rb | db/migrate/20130516174229_add_owner_to_application.rb | # frozen_string_literal: true
class AddOwnerToApplication < ActiveRecord::Migration
def change
add_column :oauth_applications, :owner_id, :integer, null: true
add_column :oauth_applications, :owner_type, :string, null: true
add_index :oauth_applications, [:owner_id, :owner_type]
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150527232652_add_subscription_id_to_purchase_codes.rb | db/migrate/20150527232652_add_subscription_id_to_purchase_codes.rb | # frozen_string_literal: true
class AddSubscriptionIdToPurchaseCodes < ActiveRecord::Migration
def change
add_column :purchase_codes, :subscription_id, :integer
add_index :purchase_codes, :subscription_id
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111110203904_add_index_to_permalink.rb | db/migrate/20111110203904_add_index_to_permalink.rb | # frozen_string_literal: true
class AddIndexToPermalink < ActiveRecord::Migration
def up
add_index :links, :unique_permalink
end
def down
remove_index :links, :unique_permalink
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120330211428_add_purchaser_id_and_credit_card_id_to_purchases.rb | db/migrate/20120330211428_add_purchaser_id_and_credit_card_id_to_purchases.rb | # frozen_string_literal: true
class AddPurchaserIdAndCreditCardIdToPurchases < ActiveRecord::Migration
def change
change_table :purchases do |t|
t.references :credit_card
t.rename :user_id, :seller_id
t.references :purchaser, polymorphic: { default: "User" }
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150129045401_add_total_transaction_cents_to_refunds.rb | db/migrate/20150129045401_add_total_transaction_cents_to_refunds.rb | # frozen_string_literal: true
class AddTotalTransactionCentsToRefunds < ActiveRecord::Migration
def change
add_column :refunds, :total_transaction_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/20210723152944_drop_fraud_refunds.rb | db/migrate/20210723152944_drop_fraud_refunds.rb | # frozen_string_literal: true
class DropFraudRefunds < ActiveRecord::Migration[6.1]
def up
drop_table :fraud_refunds
end
def down
create_table :fraud_refunds do |t|
t.bigint :refund_id, index: { unique: true }, 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/20230203130729_create_gumroad_daily_analytics.rb | db/migrate/20230203130729_create_gumroad_daily_analytics.rb | # frozen_string_literal: true
class CreateGumroadDailyAnalytics < ActiveRecord::Migration[7.0]
def change
create_table :gumroad_daily_analytics do |t|
t.datetime :period_ended_at, null: false
t.integer :gumroad_price_cents, null: false
t.integer :gumroad_fee_cents, null: false
t.integer :... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210618181618_remove_followers_cancelled_at.rb | db/migrate/20210618181618_remove_followers_cancelled_at.rb | # frozen_string_literal: true
class RemoveFollowersCancelledAt < ActiveRecord::Migration[6.1]
def up
remove_column :followers, :cancelled_at
end
def down
add_column :followers, :cancelled_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/20230716005121_create_dispute_evidences.rb | db/migrate/20230716005121_create_dispute_evidences.rb | # frozen_string_literal: true
class CreateDisputeEvidences < ActiveRecord::Migration[7.0]
def change
create_table :dispute_evidences do |t|
t.references :dispute, null: false, index: { unique: true }
t.datetime :purchased_at
t.string :customer_purchase_ip
t.string :customer_email
t.... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20211115120503_add_refund_id_to_credits.rb | db/migrate/20211115120503_add_refund_id_to_credits.rb | # frozen_string_literal: true
class AddRefundIdToCredits < ActiveRecord::Migration[6.1]
def change
add_column :credits, :refund_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/20120113223706_add_currency_to_link.rb | db/migrate/20120113223706_add_currency_to_link.rb | # frozen_string_literal: true
class AddCurrencyToLink < ActiveRecord::Migration
def change
add_column :links, :price_currency_type, :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/20140707165710_add_charge_processor_id_to_purchase.rb | db/migrate/20140707165710_add_charge_processor_id_to_purchase.rb | # frozen_string_literal: true
class AddChargeProcessorIdToPurchase < ActiveRecord::Migration
def up
add_column :purchases, :charge_processor_id, :string
Purchase.update_all({ charge_processor_id: "stripe" }, "stripe_transaction_id IS NOT NULL")
end
def down
remove_column :purchases, :charge_processo... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150128210138_add_zip_tax_rate_association_to_purchases.rb | db/migrate/20150128210138_add_zip_tax_rate_association_to_purchases.rb | # frozen_string_literal: true
class AddZipTaxRateAssociationToPurchases < ActiveRecord::Migration
def change
change_table :purchases do |t|
t.belongs_to :zip_tax_rate
end
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20221103083945_add_missing_analytics_fields_to_purchases_index.rb | db/migrate/20221103083945_add_missing_analytics_fields_to_purchases_index.rb | # frozen_string_literal: true
class AddMissingAnalyticsFieldsToPurchasesIndex < ActiveRecord::Migration[7.0]
def up
EsClient.indices.put_mapping(
index: Purchase.index_name,
body: {
properties: {
# new fields
ip_country: { type: "keyword" },
ip_state: { type: "ke... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150514183650_create_prices.rb | db/migrate/20150514183650_create_prices.rb | # frozen_string_literal: true
class CreatePrices < ActiveRecord::Migration
def change
create_table :prices, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.references :link
t.integer :price_cents, default: 0, null: false
t.string :currency, default: "usd"
t.string :... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20241031173126_add_deletable_stamped_pdfs.rb | db/migrate/20241031173126_add_deletable_stamped_pdfs.rb | # frozen_string_literal: true
class AddDeletableStampedPdfs < ActiveRecord::Migration[7.1]
def up
change_table :stamped_pdfs, bulk: true do |t|
# new columns / indexes
t.datetime :deleted_at, index: true
t.datetime :deleted_from_cdn_at, index: true
t.index :url
t.index :created_at
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231031032827_add_is_bundle_to_products_index.rb | db/migrate/20231031032827_add_is_bundle_to_products_index.rb | # frozen_string_literal: true
class AddIsBundleToProductsIndex < ActiveRecord::Migration[7.0]
def up
EsClient.indices.put_mapping(
index: Link.index_name,
body: {
properties: {
is_bundle: { 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/20111109221003_purchase_missing_attr.rb | db/migrate/20111109221003_purchase_missing_attr.rb | # frozen_string_literal: true
class PurchaseMissingAttr < ActiveRecord::Migration
def up
add_column :purchases, :owner, :string
add_column :purchases, :create_date, :integer
end
def down
remove_column :purchases, :owner
remove_column :purchases, :create_date
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130119005540_add_billing_name_and_zip_to_purchases.rb | db/migrate/20130119005540_add_billing_name_and_zip_to_purchases.rb | # frozen_string_literal: true
class AddBillingNameAndZipToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :billing_name, :string
add_column :purchases, :billing_zip_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/20131008204429_add_installment_type_to_installments.rb | db/migrate/20131008204429_add_installment_type_to_installments.rb | # frozen_string_literal: true
class AddInstallmentTypeToInstallments < ActiveRecord::Migration
def change
add_column :installments, :installment_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/20111122005846_purchase_change_create_at_type.rb | db/migrate/20111122005846_purchase_change_create_at_type.rb | # frozen_string_literal: true
class PurchaseChangeCreateAtType < ActiveRecord::Migration
def change
change_column(:purchases, :created_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/20121115040801_remove_fingerprint_index_from_events.rb | db/migrate/20121115040801_remove_fingerprint_index_from_events.rb | # frozen_string_literal: true
class RemoveFingerprintIndexFromEvents < ActiveRecord::Migration
def up
remove_index "events", "fingerprint"
end
def down
add_index "events", "fingerprint"
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240803162416_create_tips.rb | db/migrate/20240803162416_create_tips.rb | # frozen_string_literal: true
class CreateTips < ActiveRecord::Migration[7.1]
def change
create_table :tips do |t|
t.references :purchase, null: false
t.integer :value_cents, null: false
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.