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/20230327174823_create_admin_action_call_infos.rb
db/migrate/20230327174823_create_admin_action_call_infos.rb
# frozen_string_literal: true class CreateAdminActionCallInfos < ActiveRecord::Migration[7.0] def change create_table :admin_action_call_infos do |t| t.string :controller_name, null: false t.string :action_name, null: false t.integer :call_count, default: 0, null: false t.timestamps t.index [:controller_name, :action_name], 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/20190808124455_add_index_for_refunds_processor_refund_id.rb
db/migrate/20190808124455_add_index_for_refunds_processor_refund_id.rb
# frozen_string_literal: true class AddIndexForRefundsProcessorRefundId < ActiveRecord::Migration def up add_index :refunds, :processor_refund_id, unique: true end def down remove_index :refunds, :processor_refund_id end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230622131832_create_purchase_taxjar_infos.rb
db/migrate/20230622131832_create_purchase_taxjar_infos.rb
# frozen_string_literal: true class CreatePurchaseTaxjarInfos < ActiveRecord::Migration[7.0] def change create_table :purchase_taxjar_infos do |t| t.references :purchase, null: false t.decimal "combined_tax_rate", precision: 8, scale: 7 t.decimal "county_tax_rate", precision: 8, scale: 7 t.decimal "city_tax_rate", precision: 8, scale: 7 t.decimal "state_tax_rate", precision: 8, scale: 7 t.string "jurisdiction_state" t.string "jurisdiction_county" t.string "jurisdiction_city" 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/20241102102125_expire_transcoded_videos.rb
db/migrate/20241102102125_expire_transcoded_videos.rb
# frozen_string_literal: true class ExpireTranscodedVideos < ActiveRecord::Migration[7.1] def up change_table :transcoded_videos, bulk: true do |t| t.datetime :deleted_at, index: true t.datetime :last_accessed_at, index: true t.index :transcoded_video_key end end def down change_table :transcoded_videos, bulk: true do |t| t.remove :deleted_at t.remove :last_accessed_at t.remove_index :transcoded_video_key end end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111208020626_add_user_oauth_information.rb
db/migrate/20111208020626_add_user_oauth_information.rb
# 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, :twitter_user_id remove_index :users, [:twitter_user_id] end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140717232212_update_daily_metrics_index.rb
db/migrate/20140717232212_update_daily_metrics_index.rb
# frozen_string_literal: true class UpdateDailyMetricsIndex < ActiveRecord::Migration def up add_index :daily_metrics, [:event_name, :events_date, :source_type], name: "index_daily_metrics_on_event_name_events_date_and_source_type", unique: true end def down remove_index :daily_metrics, name: "index_daily_metrics_on_event_name_events_date_and_source_type" end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120803001308_add_number_of_views_to_users.rb
db/migrate/20120803001308_add_number_of_views_to_users.rb
# frozen_string_literal: true class AddNumberOfViewsToUsers < ActiveRecord::Migration def change add_column :users, :number_of_views, :integer end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231114174034_add_unique_index_on_purchase_early_fraud_warning.rb
db/migrate/20231114174034_add_unique_index_on_purchase_early_fraud_warning.rb
# 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" ) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230803151640_create_backtax_collections.rb
db/migrate/20230803151640_create_backtax_collections.rb
# frozen_string_literal: true class CreateBacktaxCollections < ActiveRecord::Migration[7.0] def change create_table :backtax_collections do |t| t.references :user, index: true, null: false t.references :backtax_agreement, index: true, null: false t.integer "amount_cents" t.integer "amount_cents_usd" t.string "currency" t.string "stripe_transfer_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/20130211200245_create_assignments.rb
db/migrate/20130211200245_create_assignments.rb
# frozen_string_literal: true class CreateAssignments < ActiveRecord::Migration def change create_table :assignments do |t| t.integer :ab_test_id t.integer :test_path_id t.string :browser_guid t.timestamps end add_index "assignments", ["browser_guid", "ab_test_id"], name: "index_assignments_on_browser_guid_and_ab_test_id", unique: true add_index "assignments", ["test_path_id", "browser_guid"], name: "index_assignments_on_test_path_id_and_browser_guid" end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150309165827_add_rental_first_viewed_at_to_url_redirects.rb
db/migrate/20150309165827_add_rental_first_viewed_at_to_url_redirects.rb
# frozen_string_literal: true class AddRentalFirstViewedAtToUrlRedirects < ActiveRecord::Migration def change add_column :url_redirects, :rental_first_viewed_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/20151021013944_add_base_variant_to_workflows.rb
db/migrate/20151021013944_add_base_variant_to_workflows.rb
# frozen_string_literal: true class AddBaseVariantToWorkflows < ActiveRecord::Migration def change add_reference :workflows, :base_variant, index: true end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20190911184143_create_installment_events.rb
db/migrate/20190911184143_create_installment_events.rb
# frozen_string_literal: true class CreateInstallmentEvents < ActiveRecord::Migration def up create_table :installment_events do |t| t.references :event, index: { unique: true }, foreign_key: { on_delete: :cascade } t.references :installment, index: { unique: true }, foreign_key: { on_delete: :cascade } end end def down drop_table :installment_events end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121004223825_add_succeeded_at_to_purchases.rb
db/migrate/20121004223825_add_succeeded_at_to_purchases.rb
# frozen_string_literal: true class AddSucceededAtToPurchases < ActiveRecord::Migration def change add_column :purchases, :succeeded_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/20210713094050_create_stripe_apple_pay_domains.rb
db/migrate/20210713094050_create_stripe_apple_pay_domains.rb
# frozen_string_literal: true class CreateStripeApplePayDomains < ActiveRecord::Migration[6.1] def change create_table :stripe_apple_pay_domains do |t| t.references :user, null: false, index: true t.string :domain, null: false, index: { unique: true } t.string :stripe_id, 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/20120614215205_change_user_bio_to_text.rb
db/migrate/20120614215205_change_user_bio_to_text.rb
# frozen_string_literal: true class ChangeUserBioToText < ActiveRecord::Migration def up change_column :users, :bio, :text end def down change_column :users, :bio, :string end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240301123315_add_charge_id_to_disputes.rb
db/migrate/20240301123315_add_charge_id_to_disputes.rb
# frozen_string_literal: true class AddChargeIdToDisputes < ActiveRecord::Migration[7.1] def change add_reference :disputes, :charge, index: true end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120323005150_add_webhooked_url_to_url_redirect.rb
db/migrate/20120323005150_add_webhooked_url_to_url_redirect.rb
# frozen_string_literal: true class AddWebhookedUrlToUrlRedirect < ActiveRecord::Migration def change add_column :url_redirects, :webhooked_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/20130430222410_add_timezone_to_users.rb
db/migrate/20130430222410_add_timezone_to_users.rb
# frozen_string_literal: true class AddTimezoneToUsers < ActiveRecord::Migration def change add_column :users, :timezone, :string, default: "Pacific Time (US & Canada)", null: false end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120718175453_add_width_to_links.rb
db/migrate/20120718175453_add_width_to_links.rb
# frozen_string_literal: true class AddWidthToLinks < ActiveRecord::Migration def change add_column :links, :width, :integer end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120820214717_add_banned_at_and_autobanned_at_to_users.rb
db/migrate/20120820214717_add_banned_at_and_autobanned_at_to_users.rb
# frozen_string_literal: true class AddBannedAtAndAutobannedAtToUsers < ActiveRecord::Migration def change add_column :users, :banned_at, :timestamp add_column :users, :autobanned_at, :timestamp end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120827162606_remove_email_required_from_users.rb
db/migrate/20120827162606_remove_email_required_from_users.rb
# frozen_string_literal: true class RemoveEmailRequiredFromUsers < ActiveRecord::Migration def up change_column :users, :email, :string, null: true end def down change_column :users, :email, :string, null: false end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20211110051320_create_signup_events.rb
db/migrate/20211110051320_create_signup_events.rb
# frozen_string_literal: true class CreateSignupEvents < ActiveRecord::Migration[6.1] def change create_table :signup_events, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| t.integer "visit_id" t.string "ip_address", limit: 255 t.integer "user_id" t.datetime "created_at" t.datetime "updated_at" t.string "referrer", limit: 255 t.string "parent_referrer", limit: 255 t.string "language", limit: 255 t.string "browser", limit: 255 t.boolean "is_mobile", default: false t.string "email", limit: 255 t.string "view_url", limit: 255 t.string "fingerprint", limit: 255 t.string "ip_country", limit: 255 t.float "ip_longitude" t.float "ip_latitude" t.boolean "is_modal" t.string "browser_fingerprint", limit: 255 t.string "browser_plugins", limit: 255 t.string "browser_guid", limit: 255 t.string "referrer_domain", limit: 255 t.string "ip_state", limit: 255 t.string "active_test_path_assignments", limit: 255 t.index ["browser_guid"], name: "index_events_on_browser_guid" t.index ["created_at"], name: "index_events_on_created_at" t.index ["ip_address"], name: "index_events_on_ip_address" t.index ["user_id"], name: "index_events_on_user_id" t.index ["visit_id"], name: "index_events_on_visit_id" # Columns derived from events table but not used t.string "event_name" t.integer "link_id" t.integer "purchase_id" t.integer "price_cents" t.integer "credit_card_id" t.string "card_type" t.string "card_visual" t.boolean "purchase_state", default: false t.string "billing_zip" t.boolean "chargeback", default: false t.boolean "refunded" end end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230120075219_create_discover_searches.rb
db/migrate/20230120075219_create_discover_searches.rb
# frozen_string_literal: true class CreateDiscoverSearches < ActiveRecord::Migration[7.0] def change create_table :discover_searches do |t| t.string :query, index: true # searched text t.references :taxonomy, index: false # taxonomy filtering the search t.references :user # logged in user t.string :ip_address, index: true t.string :browser_guid, index: true t.boolean :autocomplete, default: false, null: false t.datetime :created_at, null: false, index: true t.datetime :updated_at, null: false end end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111207004122_change_column_confirm.rb
db/migrate/20111207004122_change_column_confirm.rb
# frozen_string_literal: true class ChangeColumnConfirm < ActiveRecord::Migration def up rename_column :users, :email_verified_at, :confirmed_at add_column :users, :confirmation_token, :string add_column :users, :confirmation_sent_at, :datetime end def down rename_column :users, :confirmed_at, :email_verified_at remove_column :users, :confirmation_token remove_column :users, :confirmation_sent_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/20240206145545_add_flags_to_affiliates_links.rb
db/migrate/20240206145545_add_flags_to_affiliates_links.rb
# frozen_string_literal: true class AddFlagsToAffiliatesLinks < ActiveRecord::Migration[7.0] def change add_column :affiliates_links, :flags, :bigint, default: 0, null: false end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150625100000_add_stripe_internal_transfer_id_to_payments.rb
db/migrate/20150625100000_add_stripe_internal_transfer_id_to_payments.rb
# frozen_string_literal: true class AddStripeInternalTransferIdToPayments < ActiveRecord::Migration def change add_column :payments, :stripe_internal_transfer_id, :string end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120814044454_create_parents_children.rb
db/migrate/20120814044454_create_parents_children.rb
# frozen_string_literal: true class CreateParentsChildren < ActiveRecord::Migration def up create_table :parents_children, id: false do |t| t.references :parent t.references :child t.timestamps end add_index :parents_children, :parent_id add_index :parents_children, :child_id end def down drop_table :parents_children end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231120184536_add_folder_id_to_product_files_archives.rb
db/migrate/20231120184536_add_folder_id_to_product_files_archives.rb
# 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
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130920180213_create_resource_subscriptions.rb
db/migrate/20130920180213_create_resource_subscriptions.rb
# frozen_string_literal: true class CreateResourceSubscriptions < ActiveRecord::Migration def change create_table :resource_subscriptions do |t| t.references :oauth_application, null: false t.references :user, null: false t.string :resource_name, null: false t.string :post_url t.timestamps end add_index :resource_subscriptions, [:user_id, :oauth_application_id, :resource_name], unique: true, name: "index_resource_subscriptions_on_user_application_resource_name" add_index :resource_subscriptions, :oauth_application_id end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130731034033_index_url_redirects_on_subscription_id_and_installment_id.rb
db/migrate/20130731034033_index_url_redirects_on_subscription_id_and_installment_id.rb
# frozen_string_literal: true class IndexUrlRedirectsOnSubscriptionIdAndInstallmentId < ActiveRecord::Migration def change add_index :url_redirects, :installment_id add_index :url_redirects, :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/20130531220410_remove_follower_id_from_follows.rb
db/migrate/20130531220410_remove_follower_id_from_follows.rb
# frozen_string_literal: true class RemoveFollowerIdFromFollows < ActiveRecord::Migration def change remove_column :follows, :follower_id end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121018222140_add_browser_guid_to_events_and_visits.rb
db/migrate/20121018222140_add_browser_guid_to_events_and_visits.rb
# frozen_string_literal: true class AddBrowserGuidToEventsAndVisits < ActiveRecord::Migration def up add_column :events, :browser_guid, :string add_column :visits, :browser_guid, :string end def down remove_column :events, :browser_guid remove_column :visits, :browser_guid end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20221011114604_remove_pdf_stamp_enabled_from_link.rb
db/migrate/20221011114604_remove_pdf_stamp_enabled_from_link.rb
# frozen_string_literal: true class RemovePdfStampEnabledFromLink < ActiveRecord::Migration[6.1] def change remove_column :links, :pdf_stamp_enabled, :boolean end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231117091724_change_default_product_type.rb
db/migrate/20231117091724_change_default_product_type.rb
# frozen_string_literal: true class ChangeDefaultProductType < ActiveRecord::Migration[7.0] def change change_column_default(:links, :native_type, from: nil, to: Link::NATIVE_TYPE_DIGITAL) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20191006034047_fix_installment_events_indexes.rb
db/migrate/20191006034047_fix_installment_events_indexes.rb
# frozen_string_literal: true class FixInstallmentEventsIndexes < ActiveRecord::Migration def up change_table :installment_events do |t| t.remove_references :event, foreign_key: { on_delete: :cascade } t.remove_references :installment, foreign_key: { on_delete: :cascade } t.references :event, index: true, foreign_key: { on_delete: :cascade } t.references :installment, foreign_key: { on_delete: :cascade } t.index [:installment_id, :event_id], unique: true end end def down change_table :installment_events do |t| t.remove_references :event, foreign_key: { on_delete: :cascade } t.remove_references :installment, foreign_key: { on_delete: :cascade } t.references :event, index: { unique: true }, foreign_key: { on_delete: :cascade } t.references :installment, index: { unique: true }, foreign_key: { on_delete: :cascade } end end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20111121221801_purchase_fee_cents.rb
db/migrate/20111121221801_purchase_fee_cents.rb
# frozen_string_literal: true class PurchaseFeeCents < ActiveRecord::Migration def up add_column :purchases, :fee_cents, :integer Purchase.update_all({ fee_cents: 0 }) end def down remove_column :purchase, :fee_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/20121005003936_add_default_to_url_redirect_uses.rb
db/migrate/20121005003936_add_default_to_url_redirect_uses.rb
# frozen_string_literal: true class AddDefaultToUrlRedirectUses < ActiveRecord::Migration def change change_column :url_redirects, :uses, :integer, default: 0 end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20231002214315_remove_profile_products_settings_from_user.rb
db/migrate/20231002214315_remove_profile_products_settings_from_user.rb
# frozen_string_literal: true class RemoveProfileProductsSettingsFromUser < ActiveRecord::Migration[7.0] def up change_table :users, bulk: true do |t| t.remove :custom_css t.remove :profile_file_name t.remove :profile_content_type t.remove :profile_file_size t.remove :profile_updated_at t.remove :profile_guid t.remove :profile_meta t.remove :highlight_color t.remove :page_layout t.remove :highlighted_membership_id end end def down change_table :users, bulk: true do |t| t.column :custom_css, :text t.column :profile_file_name, :string t.column :profile_content_type, :string t.column :profile_file_size, :integer t.column :profile_updated_at, :datetime t.column :profile_guid, :string t.column :profile_meta, :string t.column :highlight_color, :string t.column :page_layout, :text t.column :highlighted_membership_id, :bigint end end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130129053932_add_title_to_variant_categories.rb
db/migrate/20130129053932_add_title_to_variant_categories.rb
# frozen_string_literal: true class AddTitleToVariantCategories < ActiveRecord::Migration def change add_column :variant_categories, :title, :string end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220211203706_add_native_product_type_to_links.rb
db/migrate/20220211203706_add_native_product_type_to_links.rb
# frozen_string_literal: true class AddNativeProductTypeToLinks < ActiveRecord::Migration[6.1] def change add_column :links, :native_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/20151029185746_add_user_categories.rb
db/migrate/20151029185746_add_user_categories.rb
# 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) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230612224821_add_destination_url_to_affiliates_links.rb
db/migrate/20230612224821_add_destination_url_to_affiliates_links.rb
# frozen_string_literal: true class AddDestinationUrlToAffiliatesLinks < ActiveRecord::Migration[7.0] def change add_column :affiliates_links, :destination_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/20150128014826_add_total_transaction_cents_to_purchase.rb
db/migrate/20150128014826_add_total_transaction_cents_to_purchase.rb
# frozen_string_literal: true class AddTotalTransactionCentsToPurchase < ActiveRecord::Migration def change add_column :purchases, :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/20140401180437_add_email_index_to_imported_customer.rb
db/migrate/20140401180437_add_email_index_to_imported_customer.rb
# frozen_string_literal: true class AddEmailIndexToImportedCustomer < ActiveRecord::Migration def change add_index :imported_customers, :email end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120816223942_allow_email_to_be_nil.rb
db/migrate/20120816223942_allow_email_to_be_nil.rb
# frozen_string_literal: true class AllowEmailToBeNil < ActiveRecord::Migration def up change_column :users, :email, :string, allow_nil: true end def down change_column :users, :email, :string, allow_nil: false end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240823204443_add_license_serial_to_elasticsearch.rb
db/migrate/20240823204443_add_license_serial_to_elasticsearch.rb
# frozen_string_literal: true class AddLicenseSerialToElasticsearch < ActiveRecord::Migration[7.1] def up EsClient.indices.put_mapping( index: Purchase.index_name, body: { properties: { license_serial: { type: "keyword" }, } } ) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120426001944_add_index_to_stripe_finger_print.rb
db/migrate/20120426001944_add_index_to_stripe_finger_print.rb
# frozen_string_literal: true class AddIndexToStripeFingerPrint < ActiveRecord::Migration def up add_index :credit_cards, :stripe_fingerprint end def down remove_index :credit_cards, :stripe_fingerprint end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130224224840_create_follow_join_table.rb
db/migrate/20130224224840_create_follow_join_table.rb
# frozen_string_literal: true class CreateFollowJoinTable < ActiveRecord::Migration def change create_table :follows, id: false do |t| t.references :follower, null: false t.references :followed, null: false end add_index :follows, [:follower_id, :followed_id], unique: true add_index :follows, :followed_id end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140624211118_add_deleted_at_to_subtitle_file.rb
db/migrate/20140624211118_add_deleted_at_to_subtitle_file.rb
# frozen_string_literal: true class AddDeletedAtToSubtitleFile < ActiveRecord::Migration def change add_column :subtitle_files, :deleted_at, :datetime end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20190110094142_remove_index_and_add_unique_index_to_product_reviews.rb
db/migrate/20190110094142_remove_index_and_add_unique_index_to_product_reviews.rb
# frozen_string_literal: true class RemoveIndexAndAddUniqueIndexToProductReviews < ActiveRecord::Migration def change reversible do |dir| dir.up do remove_foreign_key :product_reviews, :purchases remove_index :product_reviews, :purchase_id add_foreign_key :product_reviews, :purchases, on_delete: :cascade add_index :product_reviews, :purchase_id, unique: true end dir.down do remove_foreign_key :product_reviews, :purchases remove_index :product_reviews, :purchase_id add_foreign_key :product_reviews, :purchases, on_delete: :cascade add_index :product_reviews, :purchase_id end end end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121206083254_add_index_on_url_redirect_token.rb
db/migrate/20121206083254_add_index_on_url_redirect_token.rb
# frozen_string_literal: true class AddIndexOnUrlRedirectToken < ActiveRecord::Migration def up add_index :url_redirects, :token end def down remove_index :url_redirects, :token end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121003034726_add_showcaseable_index_to_links.rb
db/migrate/20121003034726_add_showcaseable_index_to_links.rb
# frozen_string_literal: true class AddShowcaseableIndexToLinks < ActiveRecord::Migration def change add_index :links, :showcaseable end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240121160328_add_message_to_product_reviews.rb
db/migrate/20240121160328_add_message_to_product_reviews.rb
# frozen_string_literal: true class AddMessageToProductReviews < ActiveRecord::Migration[7.0] def change add_column :product_reviews, :message, :text end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130105013235_add_is_developer_to_users.rb
db/migrate/20130105013235_add_is_developer_to_users.rb
# frozen_string_literal: true class AddIsDeveloperToUsers < ActiveRecord::Migration def change add_column :users, :is_developer, :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/20151015204754_add_flags_recommended_purchase_info.rb
db/migrate/20151015204754_add_flags_recommended_purchase_info.rb
# frozen_string_literal: true class AddFlagsRecommendedPurchaseInfo < ActiveRecord::Migration def change add_column :recommended_purchase_infos, :flags, :integer, default: 0, null: false end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150928999999_create_balance_transactions.rb
db/migrate/20150928999999_create_balance_transactions.rb
# frozen_string_literal: true class CreateBalanceTransactions < ActiveRecord::Migration def change create_table :balance_transactions, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t| t.timestamps t.references :user t.references :merchant_account t.references :balance t.references :purchase t.references :dispute t.references :refund t.references :credit t.datetime :occurred_at t.string :issued_amount_currency t.integer :issued_amount_gross_cents t.integer :issued_amount_net_cents t.string :holding_amount_currency t.integer :holding_amount_gross_cents t.integer :holding_amount_net_cents end add_index :balance_transactions, :user_id add_index :balance_transactions, :merchant_account_id add_index :balance_transactions, :balance_id add_index :balance_transactions, :purchase_id add_index :balance_transactions, :dispute_id add_index :balance_transactions, :refund_id add_index :balance_transactions, :credit_id end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130417235936_create_zip_tax_rates.rb
db/migrate/20130417235936_create_zip_tax_rates.rb
# frozen_string_literal: true class CreateZipTaxRates < ActiveRecord::Migration def change create_table :zip_tax_rates do |t| t.decimal :combined_rate, precision: 8, scale: 7 t.decimal :county_rate, precision: 8, scale: 7 t.decimal :special_rate, precision: 8, scale: 7 t.string :state t.decimal :state_rate, precision: 8, scale: 7 t.string :tax_region_code t.string :tax_region_name t.string :zip_code t.timestamps end add_index :zip_tax_rates, :zip_code end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230606002249_add_taxonomy_id_to_purchase_index.rb
db/migrate/20230606002249_add_taxonomy_id_to_purchase_index.rb
# frozen_string_literal: true class AddTaxonomyIdToPurchaseIndex < ActiveRecord::Migration[7.0] def up EsClient.indices.put_mapping( index: Purchase.index_name, body: { properties: { taxonomy_id: { type: "long" } } } ) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120518183456_add_attachment_preview_to_link.rb
db/migrate/20120518183456_add_attachment_preview_to_link.rb
# frozen_string_literal: true class AddAttachmentPreviewToLink < ActiveRecord::Migration def self.up add_column :links, :preview_file_name, :string add_column :links, :preview_content_type, :string add_column :links, :preview_file_size, :integer add_column :links, :preview_updated_at, :datetime end def self.down remove_column :links, :preview_file_name remove_column :links, :preview_content_type remove_column :links, :preview_file_size remove_column :links, :preview_updated_at end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230317210227_create_custom_fields.rb
db/migrate/20230317210227_create_custom_fields.rb
# frozen_string_literal: true class CreateCustomFields < ActiveRecord::Migration[7.0] def change create_table :custom_fields do |t| t.string :field_type t.string :name t.boolean :required, default: false t.boolean :global, default: false t.timestamps t.references :seller, null: false end create_table :custom_fields_products do |t| t.references :custom_field, 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/20130301205826_add_flags_to_links.rb
db/migrate/20130301205826_add_flags_to_links.rb
# frozen_string_literal: true class AddFlagsToLinks < ActiveRecord::Migration def change add_column :links, :flags, :integer, default: 0, null: false end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20200226180434_create_large_sellers.rb
db/migrate/20200226180434_create_large_sellers.rb
# frozen_string_literal: true class CreateLargeSellers < ActiveRecord::Migration def change create_table :large_sellers do |t| t.references :user, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true } t.integer :sales_count, null: false, default: 0 t.datetime :created_at, null: false t.datetime :updated_at, null: false, index: 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/20120718175207_add_bitrate_to_links.rb
db/migrate/20120718175207_add_bitrate_to_links.rb
# frozen_string_literal: true class AddBitrateToLinks < ActiveRecord::Migration def change add_column :links, :bitrate, :integer end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220318072611_add_rich_content_version_to_links.rb
db/migrate/20220318072611_add_rich_content_version_to_links.rb
# frozen_string_literal: true class AddRichContentVersionToLinks < ActiveRecord::Migration[6.1] def change add_column :links, :rich_content_version, :integer, default: 0 end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20181009174700_remove_other_category.rb
db/migrate/20181009174700_remove_other_category.rb
# frozen_string_literal: true class RemoveOtherCategory < ActiveRecord::Migration def up Category.where(name: "other").destroy_all end def down category = Category.new category.name = "other" category.save! end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20191031095419_add_index_for_ssl_certificate_issued_at.rb
db/migrate/20191031095419_add_index_for_ssl_certificate_issued_at.rb
# 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
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130531220647_remove_index_on_follows.rb
db/migrate/20130531220647_remove_index_on_follows.rb
# frozen_string_literal: true class RemoveIndexOnFollows < ActiveRecord::Migration def change remove_index :follows, name: "index_follows_on_follower_id_and_followed_id" remove_index :follows, name: "index_follows_on_followed_id" end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20250317105857_create_community_chat_recaps.rb
db/migrate/20250317105857_create_community_chat_recaps.rb
# frozen_string_literal: true class CreateCommunityChatRecaps < ActiveRecord::Migration[7.1] def change create_table :community_chat_recaps do |t| t.references :community_chat_recap_run, null: false t.references :community t.references :seller t.integer :summarized_message_count, null: false, default: 0 t.text :summary, size: :long t.string :status, null: false, index: true, default: "pending" t.string :error_message t.integer :input_token_count, null: false, default: 0 t.integer :output_token_count, null: false, default: 0 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/20220503031619_remove_dynamic_product_switches_tables.rb
db/migrate/20220503031619_remove_dynamic_product_switches_tables.rb
# 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", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.string "name" t.integer "default_switch_value" t.integer "flags", default: 0, null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "dynamic_product_page_switch_assignments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.integer "link_id" t.integer "dynamic_product_page_switch_id" t.integer "switch_value" t.datetime "deleted_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false end add_index "dynamic_product_page_switch_assignments", ["link_id", "dynamic_product_page_switch_id"], name: "index_dynamic_product_page_assignments_on_link_id_and_switch_id" end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20121113220300_add_card_bin_to_credit_cards.rb
db/migrate/20121113220300_add_card_bin_to_credit_cards.rb
# frozen_string_literal: true class AddCardBinToCreditCards < ActiveRecord::Migration def change add_column :credit_cards, :card_bin, :string end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20131209172904_create_comments.rb
db/migrate/20131209172904_create_comments.rb
# frozen_string_literal: true class CreateComments < ActiveRecord::Migration def change create_table :comments do |t| t.belongs_to :commentable, polymorphic: true t.integer :author_id t.string :author_name t.text :content t.string :comment_type t.text :json_data t.timestamps end add_index(:comments, [:commentable_id, :commentable_type]) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120731045716_add_username_index_to_users.rb
db/migrate/20120731045716_add_username_index_to_users.rb
# frozen_string_literal: true class AddUsernameIndexToUsers < ActiveRecord::Migration def change add_index :users, :username end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130531212242_add_cancelled_at_to_follows.rb
db/migrate/20130531212242_add_cancelled_at_to_follows.rb
# frozen_string_literal: true class AddCancelledAtToFollows < ActiveRecord::Migration def change add_column :follows, :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/20250416203854_add_user_to_video_files.rb
db/migrate/20250416203854_add_user_to_video_files.rb
# frozen_string_literal: true class AddUserToVideoFiles < ActiveRecord::Migration[7.1] def change add_reference :video_files, :user, null: false, foreign_key: false end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20201110060001_create_featured_posts.rb
db/migrate/20201110060001_create_featured_posts.rb
# frozen_string_literal: true class CreateFeaturedPosts < ActiveRecord::Migration[6.0] def change create_table :featured_posts do |t| t.integer :post_id, null: false t.string :category, null: false, index: { unique: true } t.timestamps null: false end # `on_delete: :restrict, on_update: :restrict` are default options add_foreign_key :featured_posts, :installments, column: :post_id end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20220110203052_create_legacy_permalinks.rb
db/migrate/20220110203052_create_legacy_permalinks.rb
# frozen_string_literal: true class CreateLegacyPermalinks < ActiveRecord::Migration[6.1] def change create_table :legacy_permalinks do |t| t.string :permalink, null: false, index: { unique: true } t.references :product, null: false, index: 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/20150929000002_add_currency_to_payments.rb
db/migrate/20150929000002_add_currency_to_payments.rb
# frozen_string_literal: true class AddCurrencyToPayments < ActiveRecord::Migration def change add_column :payments, :currency, :string, default: "usd" end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151027195941_recreate_product_tags.rb
db/migrate/20151027195941_recreate_product_tags.rb
# frozen_string_literal: true class RecreateProductTags < ActiveRecord::Migration def change create_table(:tags) do |t| t.string(:name, limit: 100) t.timestamps end add_index(:tags, :name) create_table(:product_taggings) do |t| t.belongs_to(:tag) t.belongs_to(:product) t.timestamps end add_index(:product_taggings, :tag_id) add_index(:product_taggings, :product_id) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130531231743_add_id_to_follows.rb
db/migrate/20130531231743_add_id_to_follows.rb
# frozen_string_literal: true class AddIdToFollows < ActiveRecord::Migration def change add_column :follows, :id, :primary_key end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130117015615_create_purchases_variants.rb
db/migrate/20130117015615_create_purchases_variants.rb
# frozen_string_literal: true class CreatePurchasesVariants < ActiveRecord::Migration def change create_table :purchases_variants do |t| t.integer :purchase_id t.integer :variant_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/20210624093649_remove_unused_columns_from_users.rb
db/migrate/20210624093649_remove_unused_columns_from_users.rb
# frozen_string_literal: true class RemoveUnusedColumnsFromUsers < ActiveRecord::Migration[6.1] def up change_table :users, bulk: true do |t| t.remove :reset_hash t.remove :password_salt t.remove :relationship t.remove :theme t.remove :platform_id t.change :id, :bigint, null: false, unique: true, auto_increment: true t.change :credit_card_id, :bigint t.change :highlighted_membership_id, :bigint end end def down change_table :users, bulk: true do |t| t.string :reset_hash t.string :password_salt t.integer :relationship, default: 0 t.string :theme, limit: 100 t.integer :platform_id t.change :id, :integer, null: false, unique: true, auto_increment: true t.change :credit_card_id, :integer t.change :highlighted_membership_id, :integer end end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130527194229_add_icon_guid_to_oauth_applications.rb
db/migrate/20130527194229_add_icon_guid_to_oauth_applications.rb
# frozen_string_literal: true class AddIconGuidToOauthApplications < ActiveRecord::Migration def change add_column :oauth_applications, :icon_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/20150619185755_create_third_party_analytics.rb
db/migrate/20150619185755_create_third_party_analytics.rb
# frozen_string_literal: true class CreateThirdPartyAnalytics < ActiveRecord::Migration def change create_table :third_party_analytics, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t| t.integer :user_id t.integer :link_id t.text :analytics_code t.integer :flags, default: 0, null: false t.datetime :deleted_at t.timestamps end add_index :third_party_analytics, :link_id add_index :third_party_analytics, :user_id end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240131143308_add_flags_to_gifts.rb
db/migrate/20240131143308_add_flags_to_gifts.rb
# frozen_string_literal: true class AddFlagsToGifts < ActiveRecord::Migration[7.0] def change add_column :gifts, :flags, :bigint, default: 0, null: false end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240613121849_add_email_browser_guid_and_ip_address_to_carts.rb
db/migrate/20240613121849_add_email_browser_guid_and_ip_address_to_carts.rb
# frozen_string_literal: true class AddEmailBrowserGuidAndIpAddressToCarts < ActiveRecord::Migration[7.1] def change change_table :carts, bulk: true do |t| t.string :email, index: true t.string :browser_guid, index: true t.string :ip_address end end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120706001915_change_preview_url_to_text.rb
db/migrate/20120706001915_change_preview_url_to_text.rb
# frozen_string_literal: true class ChangePreviewUrlToText < ActiveRecord::Migration def up change_column :links, :preview_url, :text end def down change_column :links, :preview_url, :text end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230420155753_remove_admin_notes_from_users.rb
db/migrate/20230420155753_remove_admin_notes_from_users.rb
# frozen_string_literal: true class RemoveAdminNotesFromUsers < ActiveRecord::Migration[7.0] def change remove_column :users, :admin_notes, :text, size: :medium end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20210402124642_add_free_trial_properties_to_products.rb
db/migrate/20210402124642_add_free_trial_properties_to_products.rb
# frozen_string_literal: true class AddFreeTrialPropertiesToProducts < ActiveRecord::Migration[6.1] def change change_table :links do |t| t.integer :free_trial_duration_unit t.integer :free_trial_duration_amount end end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120426222619_add_language_to_infos.rb
db/migrate/20120426222619_add_language_to_infos.rb
# frozen_string_literal: true class AddLanguageToInfos < ActiveRecord::Migration def change add_column :infos, :language, :string end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20150616225303_create_affiliates.rb
db/migrate/20150616225303_create_affiliates.rb
# frozen_string_literal: true class CreateAffiliates < ActiveRecord::Migration def change create_table :affiliates, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t| t.integer :seller_id t.integer :affiliate_user_id t.references :link t.integer :affiliate_basis_points t.timestamps t.datetime :deleted_at t.integer :flags, default: 0, null: false end add_index :affiliates, :seller_id add_index :affiliates, :affiliate_user_id add_index :affiliates, :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/20140507025758_add_card_data_handling_to_purchases.rb
db/migrate/20140507025758_add_card_data_handling_to_purchases.rb
# frozen_string_literal: true class AddCardDataHandlingToPurchases < ActiveRecord::Migration def change add_column :purchases, :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/20150623223829_create_affiliates_links.rb
db/migrate/20150623223829_create_affiliates_links.rb
# frozen_string_literal: true class CreateAffiliatesLinks < ActiveRecord::Migration def change create_table :affiliates_links do |t| t.references :affiliate t.references :link t.timestamps end add_index :affiliates_links, :affiliate_id add_index :affiliates_links, :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/20120411042752_add_beta_to_user.rb
db/migrate/20120411042752_add_beta_to_user.rb
# frozen_string_literal: true class AddBetaToUser < ActiveRecord::Migration def change change_table :users do |t| t.boolean :beta end end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20230306165304_create_subscription_events.rb
db/migrate/20230306165304_create_subscription_events.rb
# frozen_string_literal: true class CreateSubscriptionEvents < ActiveRecord::Migration[7.0] def change create_table :subscription_events do |t| t.references :subscription, null: false t.integer :event_type, null: false t.datetime :occurred_at, 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/20130409210205_add_index_to_link_id_on_installments.rb
db/migrate/20130409210205_add_index_to_link_id_on_installments.rb
# frozen_string_literal: true class AddIndexToLinkIdOnInstallments < ActiveRecord::Migration def change add_index :installments, :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/20230302132622_add_seller_id_to_refunds.rb
db/migrate/20230302132622_add_seller_id_to_refunds.rb
# frozen_string_literal: true class AddSellerIdToRefunds < ActiveRecord::Migration[7.0] def up change_table :refunds, bulk: true do |t| t.change :id, :bigint, null: false, unique: true, auto_increment: true t.change :purchase_id, :bigint t.change :refunding_user_id, :bigint t.change :link_id, :bigint t.column :seller_id, :bigint t.index [:seller_id, :created_at] end end def down change_table :refunds, bulk: true do |t| t.change :id, :int, null: false, unique: true, auto_increment: true t.change :purchase_id, :int t.change :refunding_user_id, :int t.change :link_id, :int t.remove_index column: [:seller_id, :created_at] t.remove :seller_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/20120813222525_add_verified_to_users.rb
db/migrate/20120813222525_add_verified_to_users.rb
# frozen_string_literal: true class AddVerifiedToUsers < ActiveRecord::Migration def change add_column :users, :verified, :boolean end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20140407214534_change_gift_note_to_text.rb
db/migrate/20140407214534_change_gift_note_to_text.rb
# frozen_string_literal: true class ChangeGiftNoteToText < ActiveRecord::Migration def up change_column :gifts, :gift_note, :text end def down change_column :links, :gift_note, :string end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240706183408_add_product_id_to_seller_profile_sections.rb
db/migrate/20240706183408_add_product_id_to_seller_profile_sections.rb
# frozen_string_literal: true class AddProductIdToSellerProfileSections < ActiveRecord::Migration[7.1] def change add_reference :seller_profile_sections, :product end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false