source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20130124024615_add_last_4_and_name_to_ach_account.rb
Ruby
mit
8,966
main
297
# frozen_string_literal: true class AddLast4AndNameToAchAccount < ActiveRecord::Migration def change add_column :ach_accounts, :account_number_last_four, :string add_column :ach_accounts, :account_holder_full_name, :string add_column :ach_accounts, :deleted_at, :datetime end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120227011227_add_filegroup_to_infos.rb
Ruby
mit
8,966
main
200
# frozen_string_literal: true class AddFilegroupToInfos < ActiveRecord::Migration def up add_column :infos, :filegroup, :string end def down remove_column :infos, :filegroup end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20181120060941_migrate_invite_statuses.rb
Ruby
mit
8,966
main
337
# frozen_string_literal: true class MigrateInviteStatuses < ActiveRecord::Migration def up Invite.where(invite_state: "paid_out").update_all(invite_state: "upgraded_to_pro") Invite.where(invite_state: "made_sale").update_all(invite_state: "signed_up") end def down raise ActiveRecord::IrreversibleMig...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20140624210443_add_product_file_id_to_subtitle_file.rb
Ruby
mit
8,966
main
224
# frozen_string_literal: true class AddProductFileIdToSubtitleFile < ActiveRecord::Migration def change add_column :subtitle_files, :product_file_id, :integer add_index :subtitle_files, :product_file_id end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230803010349_remove_audience_members_multivalued_indexes.rb
Ruby
mit
8,966
main
1,021
# frozen_string_literal: true class RemoveAudienceMembersMultivaluedIndexes < ActiveRecord::Migration[7.0] def up change_table :audience_members, bulk: true do |t| t.remove_index name: :idx_audience_on_seller_and_purchases_countries t.remove_index name: :idx_audience_on_seller_and_purchases_products_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20240725195151_add_deleted_at_index_to_product_files_archives.rb
Ruby
mit
8,966
main
1,103
# frozen_string_literal: true class AddDeletedAtIndexToProductFilesArchives < ActiveRecord::Migration[7.1] def up change_table :product_files_archives, bulk: true do |t| t.index :deleted_at t.change :id, :bigint, null: false, auto_increment: true t.change :link_id, :bigint t.change :inst...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120111204623_create_url_redirects.rb
Ruby
mit
8,966
main
248
# frozen_string_literal: true class CreateUrlRedirects < ActiveRecord::Migration def change create_table :url_redirects do |t| t.integer :uses t.integer :link_id t.datetime :expires_at t.timestamps end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20190427212700_remove_unused_tables.rb
Ruby
mit
8,966
main
10,113
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20170718061532_add_paypal_order_id_to_purchases.rb
Ruby
mit
8,966
main
211
# frozen_string_literal: true class AddPaypalOrderIdToPurchases < ActiveRecord::Migration def change add_column :purchases, :paypal_order_id, :string add_index :purchases, :paypal_order_id end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20211213122919_add_asset_previews_index_to_deleted_at.rb
Ruby
mit
8,966
main
539
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20151029185746_add_user_categories.rb
Ruby
mit
8,966
main
332
# frozen_string_literal: true class AddUserCategories < ActiveRecord::Migration def change create_table(:user_categorizations) do |t| t.belongs_to(:category) t.belongs_to(:user) t.timestamps end add_index(:user_categorizations, :category_id) add_index(:user_categorizations, :user_id...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20130514223138_create_doorkeeper_tables.rb
Ruby
mit
8,966
main
1,397
# frozen_string_literal: true class CreateDoorkeeperTables < ActiveRecord::Migration def change create_table :oauth_applications do |t| t.string :name, null: false t.string :uid, null: false t.string :secret, null: false t.string :redirect_uri, null: false ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20210728192116_rename_media_location_link_to_product.rb
Ruby
mit
8,966
main
322
# frozen_string_literal: true class RenameMediaLocationLinkToProduct < ActiveRecord::Migration[6.1] def up Alterity.disable do rename_column :media_locations, :link_id, :product_id end end def down Alterity.disable do rename_column :media_locations, :product_id, :link_id end end en...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20250217220151_add_pay_in_installments_to_cart_products.rb
Ruby
mit
8,966
main
217
# frozen_string_literal: true class AddPayInInstallmentsToCartProducts < ActiveRecord::Migration[7.1] def change add_column :cart_products, :pay_in_installments, :boolean, null: false, default: false end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20140528235035_create_twitter_merchants.rb
Ruby
mit
8,966
main
542
# frozen_string_literal: true class CreateTwitterMerchants < ActiveRecord::Migration def change create_table :twitter_merchants do |t| t.references :user t.string :email t.string :name t.string :support_email t.string :domains t.integer :twitter_assign...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20141218034930_add_time_period_and_rename_relative_delivery_time_to_duration_installment_rule.rb
Ruby
mit
8,966
main
297
# 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
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20240305161742_add_bundle_product_to_purchase_custom_fields.rb
Ruby
mit
8,966
main
203
# frozen_string_literal: true class AddBundleProductToPurchaseCustomFields < ActiveRecord::Migration[7.1] def change add_reference :purchase_custom_fields, :bundle_product, index: false end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120330210442_create_credit_cards.rb
Ruby
mit
8,966
main
367
# frozen_string_literal: true class CreateCreditCards < ActiveRecord::Migration def change create_table :credit_cards do |t| t.string :card_type t.integer :expiry_month t.integer :expiry_year t.references :user t.string :stripe_id t.string :visual t.timestamps end ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20210511080203_create_self_service_affiliate_products.rb
Ruby
mit
8,966
main
511
# frozen_string_literal: true class CreateSelfServiceAffiliateProducts < ActiveRecord::Migration[6.1] def change create_table :self_service_affiliate_products do |t| t.references :seller, type: :bigint, null: false, index: true t.references :product, type: :bigint, null: false, index: { unique: true ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120502230858_remove_facebook_and_twitter_pictures_from_users.rb
Ruby
mit
8,966
main
424
# frozen_string_literal: true class RemoveFacebookAndTwitterPicturesFromUsers < ActiveRecord::Migration def up remove_column :users, :facebook_pic_large remove_column :users, :facebook_pic_square remove_column :users, :twitter_pic end def down add_column :users, :facebook_pic_large, :string ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20240805153028_add_affiliate_credit_fee_partially_refunded_cents_to_purchases_index.rb
Ruby
mit
8,966
main
350
# frozen_string_literal: true class AddAffiliateCreditFeePartiallyRefundedCentsToPurchasesIndex < ActiveRecord::Migration[7.1] def up EsClient.indices.put_mapping( index: Purchase.index_name, body: { properties: { affiliate_credit_fee_partially_refunded_cents: { type: "long" }, ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20190528190659_backfill_megaphone_states_datetimes.rb
Ruby
mit
8,966
main
308
# frozen_string_literal: true class BackfillMegaphoneStatesDatetimes < ActiveRecord::Migration def up MegaphoneState.find_in_batches do |records| now = Time.current MegaphoneState.where(id: records.map(&:id)).update_all(created_at: now, updated_at: now) sleep(0.1) end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20111208020626_add_user_oauth_information.rb
Ruby
mit
8,966
main
389
# frozen_string_literal: true class AddUserOauthInformation < ActiveRecord::Migration def up add_column :users, :provider, :string add_column :users, :twitter_user_id, :integer add_index :users, [:twitter_user_id] end def down remove_column :users, :provider, :string remove_column :users, :t...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230404183153_remove_failed_purchases.rb
Ruby
mit
8,966
main
698
# frozen_string_literal: true class RemoveFailedPurchases < ActiveRecord::Migration[7.0] def up drop_table :failed_purchases end def down create_table "failed_purchases", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci" do |t| t.integer "link_id" t.text "email" t.strin...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120305044807_add_twitter_columns_to_user.rb
Ruby
mit
8,966
main
554
# frozen_string_literal: true class AddTwitterColumnsToUser < ActiveRecord::Migration def up add_column :users, :bio, :string add_column :users, :twitter_handle, :string add_column :users, :twitter_verified, :string add_column :users, :twitter_location, :string add_column :users, :twitter_pic, :s...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20210910115450_add_interruption_timestamps_to_subscriptions.rb
Ruby
mit
8,966
main
292
# 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
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20131205023523_drop_index_on_resource_subscriptions.rb
Ruby
mit
8,966
main
280
# 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
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20200830200804_add_base_tier_price_to_prices.rb
Ruby
mit
8,966
main
378
# 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 d...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20210624101100_remove_unused_columns_from_merchant_accounts.rb
Ruby
mit
8,966
main
551
# frozen_string_literal: true class RemoveUnusedColumnsFromMerchantAccounts < ActiveRecord::Migration[6.1] def up change_table :merchant_accounts, bulk: true do |t| t.remove :relationship t.change :id, :bigint, null: false, unique: true, auto_increment: true t.change :user_id, :bigint end ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230517152234_remove_users_recommendation_type_default.rb
Ruby
mit
8,966
main
350
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20191101194142_drop_user_underwriting.rb
Ruby
mit
8,966
main
1,110
# 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 "b...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120524014628_create_currency.rb
Ruby
mit
8,966
main
246
# frozen_string_literal: true class CreateCurrency < ActiveRecord::Migration def up create_table :currencies do |t| t.float :currency_rate t.string :currency_type end end def down drop_table :currencies end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20151028153410_add_product_categories.rb
Ruby
mit
8,966
main
483
# frozen_string_literal: true class AddProductCategories < ActiveRecord::Migration def change create_table(:categories) do |t| t.string(:name, limit: 100) t.timestamps end add_index(:categories, :name) create_table(:product_categorizations) do |t| t.belongs_to(:category) t.be...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20240726164920_add_affiliate_credit_fee_cents_to_purchases_index.rb
Ruby
mit
8,966
main
314
# frozen_string_literal: true class AddAffiliateCreditFeeCentsToPurchasesIndex < ActiveRecord::Migration[7.1] def up EsClient.indices.put_mapping( index: Purchase.index_name, body: { properties: { affiliate_credit_fee_cents: { type: "long" }, } } ) end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20231123103858_remove_legacy_url_and_webhook_columns_from_links.rb
Ruby
mit
8,966
main
445
# frozen_string_literal: true class RemoveLegacyUrlAndWebhookColumnsFromLinks < ActiveRecord::Migration[7.0] def up change_table :links, bulk: true do |t| t.remove :url t.remove :webhook t.remove :webhook_url end end def down change_table :links, bulk: true do |t| t.column :u...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20210720171856_create_fraud_refunds.rb
Ruby
mit
8,966
main
241
# frozen_string_literal: true class CreateFraudRefunds < ActiveRecord::Migration[6.1] def change create_table :fraud_refunds do |t| t.bigint :refund_id, index: { unique: true }, null: false t.timestamps end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120914010510_create_payments.rb
Ruby
mit
8,966
main
293
# 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
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120510202146_add_stripe_card_attributes_to_credit_cards.rb
Ruby
mit
8,966
main
348
# frozen_string_literal: true class AddStripeCardAttributesToCreditCards < ActiveRecord::Migration def change add_column :credit_cards, :cvc_check, :boolean add_column :credit_cards, :card_country, :string add_column :credit_cards, :stripe_card_id, :string rename_column :credit_cards, :stripe_id, :s...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20261119011938_add_idempotency_key_to_comments.rb
Ruby
mit
8,966
main
439
# frozen_string_literal: true class AddIdempotencyKeyToComments < ActiveRecord::Migration[7.1] def change change_table :comments, bulk: true do |t| t.string :idempotency_key, null: true t.index [:commentable_type, :commentable_id, :idempotency_key], unique: true, where: "i...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120510192114_add_stripe_charge_attributes_to_purchases.rb
Ruby
mit
8,966
main
593
# frozen_string_literal: true class AddStripeChargeAttributesToPurchases < ActiveRecord::Migration def change # Additional flags to keep track if something has been refunded, disputed etc. add_column :purchases, :amount_refunded_cents, :integer add_column :purchases, :stripe_disputed, :boolean add_co...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20111107215928_devise_create_users.rb
Ruby
mit
8,966
main
1,139
# frozen_string_literal: true class DeviseCreateUsers < ActiveRecord::Migration def self.up create_table(:users) do |t| # changed to upgrade devise. https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style # database authenticatable t.string(:email, def...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230211144911_create_seller_profile.rb
Ruby
mit
8,966
main
318
# frozen_string_literal: true class CreateSellerProfile < ActiveRecord::Migration[7.0] def change create_table :seller_profiles do |t| t.references :seller, index: true, null: false t.string :highlight_color t.string :background_color t.string :font t.timestamps end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20220503031619_remove_dynamic_product_switches_tables.rb
Ruby
mit
8,966
main
1,144
# frozen_string_literal: true class RemoveDynamicProductSwitchesTables < ActiveRecord::Migration[6.1] def up drop_table :dynamic_product_page_switches drop_table :dynamic_product_page_switch_assignments end def down create_table "dynamic_product_page_switches", id: :integer, charset: "utf8mb4", coll...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20240929142017_add_price_update_attributes_to_subscription_plan_changes.rb
Ruby
mit
8,966
main
280
# frozen_string_literal: true class AddPriceUpdateAttributesToSubscriptionPlanChanges < ActiveRecord::Migration[7.1] def change change_table :subscription_plan_changes, bulk: true do |t| t.date :effective_on t.datetime :notified_subscriber_at end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20111212222310_absorb_user.rb
Ruby
mit
8,966
main
317
# frozen_string_literal: true class AbsorbUser < ActiveRecord::Migration def up add_column :users, :absorbed_to_user_id, :integer add_column :users, :deleted_at, :datetime end def down remove_column :users, :absorbed_to_user_id, :integer remove_column :users, :deleted_at, :datetime end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230602014951_add_tax_refunded_cents_to_purchase_index.rb
Ruby
mit
8,966
main
297
# frozen_string_literal: true class AddTaxRefundedCentsToPurchaseIndex < ActiveRecord::Migration[7.0] def up EsClient.indices.put_mapping( index: Purchase.index_name, body: { properties: { tax_refunded_cents: { type: "long" } } } ) end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20210603164813_increase_users_flags_to_bigint.rb
Ruby
mit
8,966
main
263
# frozen_string_literal: true class IncreaseUsersFlagsToBigint < ActiveRecord::Migration[6.1] def up change_column :users, :flags, :bigint, default: 1, null: false end def down change_column :users, :flags, :int, default: 1, null: false end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20211023222329_add_available_price_cents_to_product_index.rb
Ruby
mit
8,966
main
299
# frozen_string_literal: true class AddAvailablePriceCentsToProductIndex < ActiveRecord::Migration[6.1] def up EsClient.indices.put_mapping( index: Link.index_name, body: { properties: { available_price_cents: { type: "long" }, } } ) end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20201223160647_remove_twitter_and_balance_columns_from_user.rb
Ruby
mit
8,966
main
399
# frozen_string_literal: true class RemoveTwitterAndBalanceColumnsFromUser < ActiveRecord::Migration[6.0] def up change_table :users do |t| t.remove :twitter_verified, :twitter_location, :balance_cents end end def down change_table :users do |t| t.string :twitter_verified t.string ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230125154851_create_upsells_products.rb
Ruby
mit
8,966
main
264
# 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
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20121107004632_create_blocked_browser_guids.rb
Ruby
mit
8,966
main
297
# frozen_string_literal: true class CreateBlockedBrowserGuids < ActiveRecord::Migration def change create_table :blocked_browser_guids do |t| t.string :browser_guid t.datetime :blocked_at t.timestamps end add_index :blocked_browser_guids, :browser_guid end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20250124140005_add_ip_address_and_browser_guid_to_utm_links.rb
Ruby
mit
8,966
main
239
# frozen_string_literal: true class AddIpAddressAndBrowserGuidToUtmLinks < ActiveRecord::Migration[7.1] def change change_table :utm_links, bulk: true do |t| t.string :ip_address t.string :browser_guid end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20140320192121_change_default_max_purchase_count_on_links.rb
Ruby
mit
8,966
main
280
# 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
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120820214717_add_banned_at_and_autobanned_at_to_users.rb
Ruby
mit
8,966
main
216
# frozen_string_literal: true class AddBannedAtAndAutobannedAtToUsers < ActiveRecord::Migration def change add_column :users, :banned_at, :timestamp add_column :users, :autobanned_at, :timestamp end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230706124923_remove_link_id_from_affiliates.rb
Ruby
mit
8,966
main
275
# 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
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20140630203638_add_user_requested_cancellation_at_to_subscription.rb
Ruby
mit
8,966
main
205
# frozen_string_literal: true class AddUserRequestedCancellationAtToSubscription < ActiveRecord::Migration def change add_column :subscriptions, :user_requested_cancellation_at, :datetime end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230716005121_create_dispute_evidences.rb
Ruby
mit
8,966
main
609
# 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....
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120305005646_add_facebook_column_to_users.rb
Ruby
mit
8,966
main
793
# frozen_string_literal: true class AddFacebookColumnToUsers < ActiveRecord::Migration def up add_column :users, :facebook_profile, :string add_column :users, :facebook_gender, :string add_column :users, :facebook_timezone, :string add_column :users, :facebook_locale, :string add_column :users, :...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20121108005438_add_error_code_to_purchases.rb
Ruby
mit
8,966
main
293
# frozen_string_literal: true class AddErrorCodeToPurchases < ActiveRecord::Migration def up add_column :purchases, :error_code, :string add_index :purchases, :error_code end def down remove_column :purchases, :error_code remove_index :purchases, :error_code end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20210510195127_create_audience_landing_page_view_events.rb
Ruby
mit
8,966
main
1,638
# frozen_string_literal: true class CreateAudienceLandingPageViewEvents < ActiveRecord::Migration[6.1] def change # https://dev.mysql.com/doc/refman/5.6/en/integer-types.html starting_id = 2147483648 # INT maximum value signed + 1 create_table "audience_landing_page_view_events", options: "ENGINE=InnoDB ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20151125215405_create_recurring_services.rb
Ruby
mit
8,966
main
562
# frozen_string_literal: true class CreateRecurringServices < ActiveRecord::Migration def change create_table :recurring_services, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t| t.timestamps t.references :user t.string :type t.integer :price_ce...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20251028084435_create_user_tax_forms.rb
Ruby
mit
8,966
main
401
# 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 ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20210505194727_remove_installment_events_fk_to_events.rb
Ruby
mit
8,966
main
291
# frozen_string_literal: true class RemoveInstallmentEventsFkToEvents < ActiveRecord::Migration[6.1] def up remove_foreign_key :installment_events, :events end def down add_foreign_key :installment_events, :events, name: "_fk_rails_674b6b1780", on_delete: :cascade end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20231003201734_add_additional_fields_to_dispute_evidences.rb
Ruby
mit
8,966
main
373
# frozen_string_literal: true class AddAdditionalFieldsToDisputeEvidences < ActiveRecord::Migration[7.0] def change change_table :dispute_evidences, bulk: true do |t| t.text :cancellation_rebuttal t.text :refund_refusal_explanation t.datetime :seller_contacted_at t.datetime :seller_submit...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20240423133545_add_fractional_seconds_to_papertrail_created_at.rb
Ruby
mit
8,966
main
277
# 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
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120516223533_add_sound_scan_fields_to_links.rb
Ruby
mit
8,966
main
241
# frozen_string_literal: true class AddSoundScanFieldsToLinks < ActiveRecord::Migration def change add_column :links, :soundscan, :boolean add_column :links, :upc_code, :string add_column :links, :isrc_code, :string end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20220303123204_alter_email_infos_to_utf8mb4.rb
Ruby
mit
8,966
main
1,034
# frozen_string_literal: true class AlterEmailInfosToUtf8mb4 < ActiveRecord::Migration[6.1] def up execute alter_query(charset: "utf8mb4", int_type: "bigint", varchar_limit: 255) end def down execute alter_query(charset: "utf8", int_type: "int", varchar_limit: 191) end private def alter_query(c...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20200618215815_fix_index_on_devices.rb
Ruby
mit
8,966
main
317
# 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
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120113231359_add_displayed_cost.rb
Ruby
mit
8,966
main
245
# frozen_string_literal: true class AddDisplayedCost < ActiveRecord::Migration def change add_column :purchases, :displayed_price_cents, :integer add_column :purchases, :displayed_price_currency_type, :string, default: :usd end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20130205235701_create_banks.rb
Ruby
mit
8,966
main
229
# frozen_string_literal: true class CreateBanks < ActiveRecord::Migration def change create_table :banks do |t| t.string :routing_number t.string :name end add_index :banks, :routing_number end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120423212135_change_credit_card_relation_to_users.rb
Ruby
mit
8,966
main
314
# frozen_string_literal: true class ChangeCreditCardRelationToUsers < ActiveRecord::Migration def up remove_column :credit_cards, :user_id add_column :users, :credit_card_id, :integer end def down add_column :credit_cards, :user_id, :integer remove_column :users, :credit_card_id end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20111110203904_add_index_to_permalink.rb
Ruby
mit
8,966
main
203
# 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
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230916144954_add_policy_disclosure_fields_to_dispute_evidences.rb
Ruby
mit
8,966
main
282
# frozen_string_literal: true class AddPolicyDisclosureFieldsToDisputeEvidences < ActiveRecord::Migration[7.0] def change change_table :dispute_evidences, bulk: true do |t| t.text :cancellation_policy_disclosure t.text :refund_policy_disclosure end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120917232121_update_credit_cards_stripe_fingerprint_index.rb
Ruby
mit
8,966
main
532
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20140212002303_add_index_for_imported_customer_on_url_redirects.rb
Ruby
mit
8,966
main
249
# frozen_string_literal: true class AddIndexForImportedCustomerOnUrlRedirects < ActiveRecord::Migration def up add_index :url_redirects, :imported_customer_id end def down remove_index :url_redirects, :imported_customer_id end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20231114174034_add_unique_index_on_purchase_early_fraud_warning.rb
Ruby
mit
8,966
main
328
# frozen_string_literal: true class AddUniqueIndexOnPurchaseEarlyFraudWarning < ActiveRecord::Migration[7.0] def change add_index( :purchase_early_fraud_warnings, [:purchase_id, :processor_id], unique: true, name: "index_purchase_early_fraud_warnings_on_processor_id_and_purchase" ) ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20240206135412_create_cart_products.rb
Ruby
mit
8,966
main
759
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20191101163724_add_refund_purchase_index.rb
Ruby
mit
8,966
main
200
# frozen_string_literal: true class AddRefundPurchaseIndex < ActiveRecord::Migration def up add_index :refunds, :purchase_id end def down remove_index :refunds, :purchase_id end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20130618031038_add_user_risk_state_to_users.rb
Ruby
mit
8,966
main
216
# 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
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20251110144032_remove_foreign_key_from_installment_plan_snapshots.rb
Ruby
mit
8,966
main
205
# frozen_string_literal: true class RemoveForeignKeyFromInstallmentPlanSnapshots < ActiveRecord::Migration[7.1] def change remove_foreign_key :installment_plan_snapshots, :payment_options end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120605011017_remove_fb_timezone_and_locale_from_users.rb
Ruby
mit
8,966
main
323
# 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 e...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20221107130525_add_new_offer_code_fields.rb
Ruby
mit
8,966
main
417
# frozen_string_literal: true class AddNewOfferCodeFields < ActiveRecord::Migration[7.0] def change change_table :offer_codes, bulk: true do |t| t.string :code t.boolean :universal, default: false, null: false t.index [:code, :link_id], name: "index_offer_codes_on_code_and_link_id", length: { ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120911235443_change_link_size_to_bigint.rb
Ruby
mit
8,966
main
227
# frozen_string_literal: true class ChangeLinkSizeToBigint < ActiveRecord::Migration def up change_column :links, :size, :integer, limit: 8 end def down change_column :links, :size, :integer, limit: 4 end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20121115040801_remove_fingerprint_index_from_events.rb
Ruby
mit
8,966
main
212
# frozen_string_literal: true class RemoveFingerprintIndexFromEvents < ActiveRecord::Migration def up remove_index "events", "fingerprint" end def down add_index "events", "fingerprint" end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20221017161900_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb
Ruby
mit
8,966
main
301
# frozen_string_literal: true # This migration comes from active_storage (originally 20211119233751) class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0] def change Alterity.disable do change_column_null(:active_storage_blobs, :checksum, true) end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120226203552_remove_resolution_from_infos.rb
Ruby
mit
8,966
main
208
# frozen_string_literal: true class RemoveResolutionFromInfos < ActiveRecord::Migration def up remove_column :infos, :resolution end def down add_column :infos, :resolution, :string end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20251014161000_create_installment_plan_snapshots.rb
Ruby
mit
8,966
main
503
# frozen_string_literal: true class CreateInstallmentPlanSnapshots < ActiveRecord::Migration[7.1] def change create_table :installment_plan_snapshots do |t| t.integer :payment_option_id, null: false t.integer :number_of_installments, null: false t.string :recurrence, null: false t.integer...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230622201742_add_duration_in_months_to_purchase_offer_code_discounts.rb
Ruby
mit
8,966
main
250
# frozen_string_literal: true class AddDurationInMonthsToPurchaseOfferCodeDiscounts < ActiveRecord::Migration[7.0] def change change_table :purchase_offer_code_discounts, bulk: true do |t| t.integer :duration_in_months end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20120531014554_remove_price_cents_from_failed_purchases.rb
Ruby
mit
8,966
main
242
# frozen_string_literal: true class RemovePriceCentsFromFailedPurchases < ActiveRecord::Migration def up remove_column :failed_purchases, :price_cents end def down add_column :failed_purchases, :price_cents, :string end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20220907151951_add_notification_content_type_to_user.rb
Ruby
mit
8,966
main
229
# frozen_string_literal: true class AddNotificationContentTypeToUser < ActiveRecord::Migration[6.1] def change add_column :users, :notification_content_type, :string, default: "application/x-www-form-urlencoded" end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20130801203354_create_daily_metrics.rb
Ruby
mit
8,966
main
355
# frozen_string_literal: true class CreateDailyMetrics < ActiveRecord::Migration def change create_table :daily_metrics do |t| t.string :event_name t.date :events_date t.integer :event_count t.integer :user_count t.timestamps end add_index :daily_metrics, [:event_name, :ev...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20121115184907_remove_reset_password_index_from_users.rb
Ruby
mit
8,966
main
229
# frozen_string_literal: true class RemoveResetPasswordIndexFromUsers < ActiveRecord::Migration def up remove_index "users", "reset_password_token" end def down add_index "users", "reset_password_token" end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20231120184536_add_folder_id_to_product_files_archives.rb
Ruby
mit
8,966
main
244
# frozen_string_literal: true class AddFolderIdToProductFilesArchives < ActiveRecord::Migration[7.0] def change change_table :product_files_archives, bulk: true do |t| t.string :folder_id t.index :folder_id end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20140703212413_prepare_base_variant.rb
Ruby
mit
8,966
main
582
# frozen_string_literal: true class PrepareBaseVariant < ActiveRecord::Migration def change rename_table :variants, :base_variants rename_table :purchases_variants, :base_variants_purchases rename_column :base_variants_purchases, :variant_id, :base_variant_id add_column :base_variants, :type, :string...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20200110072114_create_sent_email_infos.rb
Ruby
mit
8,966
main
257
# frozen_string_literal: true class CreateSentEmailInfos < ActiveRecord::Migration def change create_table :sent_email_infos do |t| t.string :key, limit: 40, null: false, index: { unique: true } t.timestamps null: false end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20130718214055_add_city_rate_to_zip_tax_rates.rb
Ruby
mit
8,966
main
250
# frozen_string_literal: true class AddCityRateToZipTaxRates < ActiveRecord::Migration def change rename_column :zip_tax_rates, :special_rate, :city_rate add_column :zip_tax_rates, :special_rate, :decimal, precision: 8, scale: 7 end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20241008140243_remove_unique_index_constraint_from_refunds_processor_refund_id.rb
Ruby
mit
8,966
main
435
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20191031095419_add_index_for_ssl_certificate_issued_at.rb
Ruby
mit
8,966
main
253
# frozen_string_literal: true class AddIndexForSslCertificateIssuedAt < ActiveRecord::Migration def up add_index :custom_domains, :ssl_certificate_issued_at end def down remove_index :custom_domains, :ssl_certificate_issued_at end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230412221512_modify_upsells.rb
Ruby
mit
8,966
main
312
# frozen_string_literal: true class ModifyUpsells < ActiveRecord::Migration[7.0] def change change_table(:upsells, bulk: true) do |t| t.rename :offered_product_id, :product_id t.rename :offered_variant_id, :variant_id t.boolean :universal, null: false, default: false end end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
db/migrate/20230605234115_create_taxonomy_stats.rb
Ruby
mit
8,966
main
388
# frozen_string_literal: true class CreateTaxonomyStats < ActiveRecord::Migration[7.0] def change create_table :taxonomy_stats do |t| t.references :taxonomy, null: false t.integer :creators_count, null: false, default: 0 t.integer :products_count, null: false, default: 0 t.integer :sales_...