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/20150309165638_add_purchase_type_and_rental_price_cents_to_links.rb | Ruby | mit | 8,966 | main | 240 | # frozen_string_literal: true
class AddPurchaseTypeAndRentalPriceCentsToLinks < ActiveRecord::Migration
def change
add_column :links, :rental_price_cents, :integer
rename_column :links, :number_of_views, :purchase_type
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20230926133822_drop_subscription_interruption_timestamps.rb | Ruby | mit | 8,966 | main | 412 | # frozen_string_literal: true
class DropSubscriptionInterruptionTimestamps < ActiveRecord::Migration[7.0]
def up
change_table :subscriptions, bulk: true do |t|
t.remove :last_resubscribed_at
t.remove :last_deactivated_at
end
end
def down
change_table :subscriptions, bulk: true do |t|
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20240203193839_remove_legacy_profile_section_fields.rb | Ruby | mit | 8,966 | main | 402 | # frozen_string_literal: true
class RemoveLegacyProfileSectionFields < ActiveRecord::Migration[7.0]
def up
remove_columns :seller_profile_sections, :shown_products, :show_filters, :default_product_sort
end
def down
change_table :seller_profile_sections, bulk: true do |t|
t.text :shown_products
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20131114070727_create_stamped_pdfs.rb | Ruby | mit | 8,966 | main | 302 | # frozen_string_literal: true
class CreateStampedPdfs < ActiveRecord::Migration
def change
create_table :stamped_pdfs do |t|
t.integer :url_redirect_id
t.integer :product_file_id
t.string :url
t.timestamps
end
add_index :stamped_pdfs, :url_redirect_id
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20210723170128_create_media_location.rb | Ruby | mit | 8,966 | main | 620 | # frozen_string_literal: true
class CreateMediaLocation < ActiveRecord::Migration[6.1]
def change
create_table :media_locations do |t|
t.integer :product_file_id, null: false
t.integer :url_redirect_id, null: false
t.integer :purchase_id, null: false
t.integer :link_id, null: false
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20240125071935_add_disputes_seller_id.rb | Ruby | mit | 8,966 | main | 345 | # frozen_string_literal: true
class AddDisputesSellerId < ActiveRecord::Migration[7.0]
def change
change_table :disputes, bulk: true do |t|
t.bigint :seller_id
t.datetime :event_created_at
t.index [:seller_id, :event_created_at]
t.index [:seller_id, :won_at]
t.index [:seller_id, :lo... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20130220170734_create_sxsw_meetings.rb | Ruby | mit | 8,966 | main | 346 | # frozen_string_literal: true
class CreateSxswMeetings < ActiveRecord::Migration
def change
create_table :sxsw_meetings do |t|
t.string :email
t.string :name
t.integer :time_slot
t.boolean :confirmed
t.text :message
t.string :guest_name
t.string :guest_email
t.tim... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20200330184434_add_description_to_base_variants.rb | Ruby | mit | 8,966 | main | 241 | # frozen_string_literal: true
class AddDescriptionToBaseVariants < ActiveRecord::Migration
def up
add_column :base_variants, :description, :string, limit: 255
end
def down
remove_column :base_variants, :description
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20230412221903_rename_upsells_products_to_upsells_selected_products.rb | Ruby | mit | 8,966 | main | 201 | # frozen_string_literal: true
class RenameUpsellsProductsToUpsellsSelectedProducts < ActiveRecord::Migration[7.0]
def change
rename_table :upsells_products, :upsells_selected_products
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20230123055438_create_correlated_taxonomies.rb | Ruby | mit | 8,966 | main | 307 | # frozen_string_literal: true
class CreateCorrelatedTaxonomies < ActiveRecord::Migration[7.0]
def change
create_table :correlated_taxonomies do |t|
t.references :taxonomy, index: { unique: true }, null: false
t.json :related_taxonomy_ids, null: false
t.timestamps
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20190504212349_sync_dev_columns_lengths_and_positions.rb | Ruby | mit | 8,966 | main | 12,735 | # frozen_string_literal: true
class SyncDevColumnsLengthsAndPositions < ActiveRecord::Migration
def up
VARCHARS_CHANGES_FROM_191_TO_255.each do |table_name, columns_names|
columns_names.each do |column_name|
change_column(table_name, column_name, :string, limit: 255)
end
end
TEXTS_CH... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20140911204600_change_territory_restriction_to_text.rb | Ruby | mit | 8,966 | main | 247 | # frozen_string_literal: true
class ChangeTerritoryRestrictionToText < ActiveRecord::Migration
def up
change_column :links, :territory_restriction, :text
end
def down
change_column :links, :territory_restriction, :string
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20160105231848_add_service_charge_to_disputes.rb | Ruby | mit | 8,966 | main | 215 | # frozen_string_literal: true
class AddServiceChargeToDisputes < ActiveRecord::Migration
def change
add_column :disputes, :service_charge_id, :integer
add_index :disputes, :service_charge_id
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20240626144207_create_commissions.rb | Ruby | mit | 8,966 | main | 274 | # frozen_string_literal: true
class CreateCommissions < ActiveRecord::Migration[7.1]
def change
create_table :commissions do |t|
t.string :status
t.references :deposit_purchase
t.references :completion_purchase
t.timestamps
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20230306165304_create_subscription_events.rb | Ruby | mit | 8,966 | main | 319 | # 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 |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20120226203405_change_framerate_to_integer.rb | Ruby | mit | 8,966 | main | 218 | # frozen_string_literal: true
class ChangeFramerateToInteger < ActiveRecord::Migration
def up
change_column :infos, :framerate, :integer
end
def down
change_column :infos, :framerate, :string
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20210728154434_create_confirmed_follower_events_index.rb | Ruby | mit | 8,966 | main | 815 | # frozen_string_literal: true
class CreateConfirmedFollowerEventsIndex < ActiveRecord::Migration[6.1]
def up
if Rails.env.production? || Rails.env.staging?
ConfirmedFollowerEvent.__elasticsearch__.create_index!(index: "confirmed_follower_events_v1")
EsClient.indices.put_alias(name: "confirmed_followe... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20250317105857_create_community_chat_recaps.rb | Ruby | mit | 8,966 | main | 629 | # 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: fa... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20130117015306_create_variant_categories.rb | Ruby | mit | 8,966 | main | 217 | # frozen_string_literal: true
class CreateVariantCategories < ActiveRecord::Migration
def change
create_table :variant_categories do |t|
t.integer :link_id
t.datetime :deleted_at
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20150921173816_add_default_value_to_licenses_flag.rb | Ruby | mit | 8,966 | main | 248 | # frozen_string_literal: true
class AddDefaultValueToLicensesFlag < ActiveRecord::Migration
def up
change_column :licenses, :flags, :integer, default: 0
end
def down
change_column :licenses, :flags, :integer, default: nil
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20120516222956_remove_amounts_refunded_cents_from_purchases.rb | Ruby | mit | 8,966 | main | 253 | # frozen_string_literal: true
class RemoveAmountsRefundedCentsFromPurchases < ActiveRecord::Migration
def up
remove_column :purchases, :amount_refunded_cents
end
def down
add_column :purchases, :amount_refunded_cents, :integer
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20140407214534_change_gift_note_to_text.rb | Ruby | mit | 8,966 | main | 211 | # 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 |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20240928021009_drop_admin_action_call_infos_table.rb | Ruby | mit | 8,966 | main | 479 | # frozen_string_literal: true
class DropAdminActionCallInfosTable < ActiveRecord::Migration[7.1]
def up
drop_table :admin_action_call_infos
end
def down
create_table :admin_action_call_infos do |t|
t.string :controller_name, null: false
t.string :action_name, null: false
t.integer :cal... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20231031032827_add_is_bundle_to_products_index.rb | Ruby | mit | 8,966 | main | 279 | # frozen_string_literal: true
class AddIsBundleToProductsIndex < ActiveRecord::Migration[7.0]
def up
EsClient.indices.put_mapping(
index: Link.index_name,
body: {
properties: {
is_bundle: { type: "boolean" }
}
}
)
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20130119005540_add_billing_name_and_zip_to_purchases.rb | Ruby | mit | 8,966 | main | 222 | # frozen_string_literal: true
class AddBillingNameAndZipToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :billing_name, :string
add_column :purchases, :billing_zip_code, :string
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20201110060001_create_featured_posts.rb | Ruby | mit | 8,966 | main | 433 | # 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_updat... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20230125154900_create_upsell_purchases.rb | Ruby | mit | 8,966 | main | 350 | # frozen_string_literal: true
class CreateUpsellPurchases < ActiveRecord::Migration[7.0]
def change
create_table :upsell_purchases do |t|
t.references :upsell, null: false
t.references :purchase, null: false
t.references :selected_product, null: false
t.references :upsell_variant
t... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20190906151752_create_profile_tags.rb | Ruby | mit | 8,966 | main | 485 | # frozen_string_literal: true
class CreateProfileTags < ActiveRecord::Migration
def change
create_table :profile_tags do |t|
t.references :user, null: false, foreign_key: { on_delete: :cascade }
t.references :tag, null: false, foreign_key: { on_delete: :cascade }
t.boolean :active, default: tru... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20150616174834_add_affiliate_id_to_affiliate_credits.rb | Ruby | mit | 8,966 | main | 226 | # frozen_string_literal: true
class AddAffiliateIdToAffiliateCredits < ActiveRecord::Migration
def change
add_column :affiliate_credits, :affiliate_id, :integer
add_index :affiliate_credits, :affiliate_id
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20150729324908_add_link_id_to_consumption_events.rb | Ruby | mit | 8,966 | main | 214 | # frozen_string_literal: true
class AddLinkIdToConsumptionEvents < ActiveRecord::Migration
def change
add_column :consumption_events, :link_id, :integer
add_index :consumption_events, :link_id
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20240619073817_create_cached_sales_related_products_infos.rb | Ruby | mit | 8,966 | main | 304 | # frozen_string_literal: true
class CreateCachedSalesRelatedProductsInfos < ActiveRecord::Migration[7.1]
def change
create_table :cached_sales_related_products_infos do |t|
t.bigint :product_id, null: false, index: { unique: true }
t.json :counts
t.timestamps
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20120501232218_add_profile_picture_url_to_users.rb | Ruby | mit | 8,966 | main | 2,243 | # frozen_string_literal: true
class AddProfilePictureUrlToUsers < ActiveRecord::Migration
def up
unless column_exists? :users, :profile_picture_url
add_column :users, :profile_picture_url, :string
end
migrate_avatar_pictures
end
def down
remove_column :users, :profile_picture_url
end
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20240402134432_add_is_recommendable_and_is_alive_on_profile_to_products_index.rb | Ruby | mit | 8,966 | main | 365 | # frozen_string_literal: true
class AddIsRecommendableAndIsAliveOnProfileToProductsIndex < ActiveRecord::Migration[7.1]
def up
EsClient.indices.put_mapping(
index: Link.index_name,
body: {
properties: {
is_recommendable: { type: "boolean" },
is_alive_on_profile: { type: "b... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20120415221152_add_shipping_info_to_links_and_purchases.rb | Ruby | mit | 8,966 | main | 417 | # frozen_string_literal: true
class AddShippingInfoToLinksAndPurchases < ActiveRecord::Migration
def change
add_column :purchases, :street_address, :string
add_column :purchases, :city, :string
add_column :purchases, :state, :string
add_column :purchases, :zip_code, :string
add_column :purchases,... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20151015204754_add_flags_recommended_purchase_info.rb | Ruby | mit | 8,966 | main | 204 | # frozen_string_literal: true
class AddFlagsRecommendedPurchaseInfo < ActiveRecord::Migration
def change
add_column :recommended_purchase_infos, :flags, :integer, default: 0, null: false
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20120330211428_add_purchaser_id_and_credit_card_id_to_purchases.rb | Ruby | mit | 8,966 | main | 302 | # frozen_string_literal: true
class AddPurchaserIdAndCreditCardIdToPurchases < ActiveRecord::Migration
def change
change_table :purchases do |t|
t.references :credit_card
t.rename :user_id, :seller_id
t.references :purchaser, polymorphic: { default: "User" }
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20230629014321_add_minimum_amount_cents_to_offer_codes.rb | Ruby | mit | 8,966 | main | 220 | # frozen_string_literal: true
class AddMinimumAmountCentsToOfferCodes < ActiveRecord::Migration[7.0]
def change
change_table :offer_codes, bulk: true do |t|
t.integer :minimum_amount_cents
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20151005000000_remove_tax_id_type_columns_from_user_compliance_info.rb | Ruby | mit | 8,966 | main | 259 | # frozen_string_literal: true
class RemoveTaxIdTypeColumnsFromUserComplianceInfo < ActiveRecord::Migration
def change
remove_column :user_compliance_info, :individual_tax_id_type
remove_column :user_compliance_info, :business_tax_id_type
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20250406055017_add_index_to_followers_table.rb | Ruby | mit | 8,966 | main | 325 | # frozen_string_literal: true
class AddIndexToFollowersTable < ActiveRecord::Migration[7.1]
def change
change_table :followers, bulk: true do |t|
t.index [:followed_id, :confirmed_at]
t.remove_index [:followed_id, :follower_user_id]
t.remove_index [:follower_user_id, :followed_id]
end
end... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20120522211546_add_meta_to_links_and_users.rb | Ruby | mit | 8,966 | main | 387 | # frozen_string_literal: true
class AddMetaToLinksAndUsers < ActiveRecord::Migration
def up
add_column :links, :preview_meta, :string
add_column :links, :attachment_meta, :string
add_column :users, :profile_meta, :string
end
def down
remove_column :links, :preview_meta
remove_column :links, ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20250103131741_create_utm_link_driven_sales.rb | Ruby | mit | 8,966 | main | 380 | # frozen_string_literal: true
class CreateUtmLinkDrivenSales < ActiveRecord::Migration[7.1]
def change
create_table :utm_link_driven_sales do |t|
t.references :utm_link, null: false
t.references :utm_link_visit, null: false
t.references :order, null: false
t.timestamps
t.index [:ut... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20190910183443_add_slug_to_installments.rb | Ruby | mit | 8,966 | main | 255 | # frozen_string_literal: true
class AddSlugToInstallments < ActiveRecord::Migration
def up
add_column :installments, :slug, :string
add_index :installments, :slug, unique: true
end
def down
remove_column :installments, :slug
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20201023151726_create_active_storage_tables.active_storage.rb | Ruby | mit | 8,966 | main | 995 | # frozen_string_literal: true
# This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
def change
create_table :active_storage_blobs do |t|
t.string :key, null: false
t.string :filename, null: false
t.stri... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20221103083945_add_missing_analytics_fields_to_purchases_index.rb | Ruby | mit | 8,966 | main | 1,290 | # frozen_string_literal: true
class AddMissingAnalyticsFieldsToPurchasesIndex < ActiveRecord::Migration[7.0]
def up
EsClient.indices.put_mapping(
index: Purchase.index_name,
body: {
properties: {
# new fields
ip_country: { type: "keyword" },
ip_state: { type: "ke... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20221128145639_add_quantity_to_subscription_plan_change.rb | Ruby | mit | 8,966 | main | 250 | # frozen_string_literal: true
class AddQuantityToSubscriptionPlanChange < ActiveRecord::Migration[7.0]
def change
change_table :subscription_plan_changes, bulk: true do |t|
t.integer "quantity", default: 1, null: false
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20220729201912_remove_links_custom_fields.rb | Ruby | mit | 8,966 | main | 230 | # frozen_string_literal: true
class RemoveLinksCustomFields < ActiveRecord::Migration[6.1]
def up
remove_column :links, :custom_fields
end
def down
add_column :links, :custom_fields, :text, size: :medium
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20210716062630_remove_unused_purchases_columns.rb | Ruby | mit | 8,966 | main | 2,802 | # frozen_string_literal: true
class RemoveUnusedPurchasesColumns < ActiveRecord::Migration[6.1]
def up
change_table :purchases, bulk: true do |t|
# Added
t.datetime :deleted_at
t.index [:purchase_state, :created_at]
# Changed
t.change :id, :bigint, null: false, unique: true, auto_i... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20150810000000_add_processor_fee_cents_currency_to_purchases.rb | Ruby | mit | 8,966 | main | 208 | # frozen_string_literal: true
class AddProcessorFeeCentsCurrencyToPurchases < ActiveRecord::Migration
def change
add_column :purchases, :processor_fee_cents_currency, :string, default: "usd"
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20120516194950_remove_balance_cents_from_links.rb | Ruby | mit | 8,966 | main | 217 | # frozen_string_literal: true
class RemoveBalanceCentsFromLinks < ActiveRecord::Migration
def up
remove_column :links, :balance_cents
end
def down
add_column :links, :balance_cents, :integer
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20150211000000_create_user_underwriting.rb | Ruby | mit | 8,966 | main | 825 | # frozen_string_literal: true
class CreateUserUnderwriting < ActiveRecord::Migration
def change
create_table :user_underwriting, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.references :user
t.references :user_compliance_info
t.references :bank_account
t.integer ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20120430183904_remove_language_from_infos.rb | Ruby | mit | 8,966 | main | 202 | # frozen_string_literal: true
class RemoveLanguageFromInfos < ActiveRecord::Migration
def up
remove_column :infos, :language
end
def down
add_column :infos, :language, :string
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20220830182631_remove_links_variants.rb | Ruby | mit | 8,966 | main | 216 | # frozen_string_literal: true
class RemoveLinksVariants < ActiveRecord::Migration[6.1]
def up
remove_column :links, :variants
end
def down
add_column :links, :variants, :text, size: :medium
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20240620200757_create_call_limitation_infos.rb | Ruby | mit | 8,966 | main | 312 | # frozen_string_literal: true
class CreateCallLimitationInfos < ActiveRecord::Migration[7.1]
def change
create_table :call_limitation_infos do |t|
t.references :call, null: false
t.integer :minimum_notice_in_minutes
t.integer :maximum_calls_per_day
t.timestamps
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20231123113306_remove_url_from_base_variants.rb | Ruby | mit | 8,966 | main | 215 | # frozen_string_literal: true
class RemoveUrlFromBaseVariants < ActiveRecord::Migration[7.0]
def up
remove_column :base_variants, :url
end
def down
add_column :base_variants, :url, :string
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20220626140322_create_sent_post_emails.rb | Ruby | mit | 8,966 | main | 300 | # frozen_string_literal: true
class CreateSentPostEmails < ActiveRecord::Migration[6.1]
def change
create_table :sent_post_emails do |t|
t.bigint :post_id, null: false
t.string :email, null: false
t.timestamps
t.index [:post_id, :email], unique: true
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20241031173126_add_deletable_stamped_pdfs.rb | Ruby | mit | 8,966 | main | 1,046 | # frozen_string_literal: true
class AddDeletableStampedPdfs < ActiveRecord::Migration[7.1]
def up
change_table :stamped_pdfs, bulk: true do |t|
# new columns / indexes
t.datetime :deleted_at, index: true
t.datetime :deleted_from_cdn_at, index: true
t.index :url
t.index :created_at
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20220318214047_create_rich_contents.rb | Ruby | mit | 8,966 | main | 368 | # frozen_string_literal: true
class CreateRichContents < ActiveRecord::Migration[6.1]
def change
create_table :rich_contents do |t|
t.bigint :entity_id, null: false
t.string :entity_type, null: false
t.json :description, null: false
t.timestamps
end
add_index :rich_contents, [:e... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20240802152405_add_fee_cents_to_affiliate_partial_refunds.rb | Ruby | mit | 8,966 | main | 203 | # frozen_string_literal: true
class AddFeeCentsToAffiliatePartialRefunds < ActiveRecord::Migration[7.1]
def change
add_column :affiliate_partial_refunds, :fee_cents, :bigint, default: 0
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20230903162345_create_bundle_products.rb | Ruby | mit | 8,966 | main | 358 | # frozen_string_literal: true
class CreateBundleProducts < ActiveRecord::Migration[7.0]
def change
create_table :bundle_products do |t|
t.references :bundle, null: false
t.references :product, null: false
t.references :variant
t.integer :quantity, null: false
t.datetime :deleted_at
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20240928021005_add_past_year_fee_cents_to_products_index.rb | Ruby | mit | 8,966 | main | 295 | # frozen_string_literal: true
class AddPastYearFeeCentsToProductsIndex < ActiveRecord::Migration[7.1]
def up
EsClient.indices.put_mapping(
index: Link.index_name,
body: {
properties: {
past_year_fee_cents: { type: "long" },
}
}
)
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20220513062810_create_purchase_integration.rb | Ruby | mit | 8,966 | main | 444 | # frozen_string_literal: true
class CreatePurchaseIntegration < ActiveRecord::Migration[6.1]
def change
create_table :purchase_integrations do |t|
t.bigint :purchase_id, null: false
t.bigint :integration_id, null: false
t.datetime :deleted_at
t.string :discord_user_id
t.timestamps
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20250225092546_create_last_read_community_chat_messages.rb | Ruby | mit | 8,966 | main | 406 | # frozen_string_literal: true
class CreateLastReadCommunityChatMessages < ActiveRecord::Migration[7.1]
def change
create_table :last_read_community_chat_messages do |t|
t.references :user, null: false
t.references :community, null: false
t.references :community_chat_message, null: false
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20220413003135_add_taxonomy_id_to_product_index.rb | Ruby | mit | 8,966 | main | 279 | # frozen_string_literal: true
class AddTaxonomyIdToProductIndex < ActiveRecord::Migration[6.1]
def up
EsClient.indices.put_mapping(
index: Link.index_name,
body: {
properties: {
taxonomy_id: { type: "long" }
}
}
)
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20190916230459_resize_installments_slugs_column.rb | Ruby | mit | 8,966 | main | 378 | # frozen_string_literal: true
class ResizeInstallmentsSlugsColumn < ActiveRecord::Migration
def up
safety_assured do
execute "ALTER TABLE `installments` CHANGE `slug` `slug` varchar(255) NULL COMMENT '';"
end
end
def down
safety_assured do
execute "ALTER TABLE `installments` CHANGE `slug... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20261123000000_add_license_uses_to_elasticsearch.rb | Ruby | mit | 8,966 | main | 287 | # frozen_string_literal: true
class AddLicenseUsesToElasticsearch < ActiveRecord::Migration[7.1]
def up
EsClient.indices.put_mapping(
index: Purchase.index_name,
body: {
properties: {
license_uses: { type: "long" },
}
}
)
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20240613121849_add_email_browser_guid_and_ip_address_to_carts.rb | Ruby | mit | 8,966 | main | 285 | # 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 |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20111213214129_change_balance.rb | Ruby | mit | 8,966 | main | 321 | # frozen_string_literal: true
class ChangeBalance < ActiveRecord::Migration
def up
add_column :links, :balance_cents, :integer
Link.find_each do |link|
link.balance_cents = link.balance * 100
link.save(validation: false)
end
end
def down
remove_column :links, :balance_cents
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20130625000244_create_dynamic_product_page_switches.rb | Ruby | mit | 8,966 | main | 309 | # frozen_string_literal: true
class CreateDynamicProductPageSwitches < ActiveRecord::Migration
def change
create_table :dynamic_product_page_switches do |t|
t.string :name
t.integer :default_switch_value
t.integer :flags, default: 0, null: false
t.timestamps
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20121009015308_remove_unique_permalink_from_purchases.rb | Ruby | mit | 8,966 | main | 237 | # frozen_string_literal: true
class RemoveUniquePermalinkFromPurchases < ActiveRecord::Migration
def up
remove_column :purchases, :unique_permalink
end
def down
add_column :purchases, :unique_permalink, :string
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20250103145344_add_deleted_at_and_disabled_at_to_utm_links.rb | Ruby | mit | 8,966 | main | 286 | # frozen_string_literal: true
class AddDeletedAtAndDisabledAtToUtmLinks < ActiveRecord::Migration[7.1]
def change
change_table :utm_links, bulk: true do |t|
t.datetime :deleted_at, precision: nil, index: true
t.datetime :disabled_at, precision: nil
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20150402215254_add_tracking_number_and_carrier_to_shipment.rb | Ruby | mit | 8,966 | main | 222 | # frozen_string_literal: true
class AddTrackingNumberAndCarrierToShipment < ActiveRecord::Migration
def change
add_column :shipments, :tracking_number, :string
add_column :shipments, :carrier, :string
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20210622064046_remove_unused_columns_from_preorder_links.rb | Ruby | mit | 8,966 | main | 548 | # frozen_string_literal: true
class RemoveUnusedColumnsFromPreorderLinks < ActiveRecord::Migration[6.1]
def up
change_table :preorder_links, bulk: true do |t|
t.remove :attachment_guid
t.change :id, :bigint, null: false, unique: true, auto_increment: true
t.change :link_id, :bigint
end
en... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20150416052056_create_purchase_sales_tax_info.rb | Ruby | mit | 8,966 | main | 450 | # frozen_string_literal: true
class CreatePurchaseSalesTaxInfo < ActiveRecord::Migration
def change
create_table :purchase_sales_tax_infos, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.references :purchase
t.string :elected_country_code
t.string :card_country_code
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20141218034833_create_workflows.rb | Ruby | mit | 8,966 | main | 404 | # frozen_string_literal: true
class CreateWorkflows < ActiveRecord::Migration
def change
create_table :workflows do |t|
t.string :name
t.integer :seller_id
t.integer :link_id
t.string :workflow_type
t.datetime :published_at
t.datetime :deleted_at
t.timestamps
end
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20210623231346_remove_unused_columns_from_payments.rb | Ruby | mit | 8,966 | main | 718 | # frozen_string_literal: true
class RemoveUnusedColumnsFromPayments < ActiveRecord::Migration[6.1]
def up
change_table :payments, bulk: true do |t|
t.remove :status_data
t.remove :unique_id
t.remove :local_currency
t.change :id, :bigint, null: false, unique: true, auto_increment: true
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20250115144823_change_utm_links_target_resource_id_column_type.rb | Ruby | mit | 8,966 | main | 264 | # frozen_string_literal: true
class ChangeUtmLinksTargetResourceIdColumnType < ActiveRecord::Migration[7.1]
def up
change_column :utm_links, :target_resource_id, :bigint
end
def down
change_column :utm_links, :target_resource_id, :string
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20230825141116_remove_null_constraint_subscription_plan_change_tier.rb | Ruby | mit | 8,966 | main | 212 | # frozen_string_literal: true
class RemoveNullConstraintSubscriptionPlanChangeTier < ActiveRecord::Migration[7.0]
def change
change_column_null :subscription_plan_changes, :base_variant_id, true
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20250122100830_rename_utm_link_driven_sales_order_id_to_purchase_id.rb | Ruby | mit | 8,966 | main | 429 | # frozen_string_literal: true
class RenameUtmLinkDrivenSalesOrderIdToPurchaseId < ActiveRecord::Migration[7.1]
def change
change_table :utm_link_driven_sales, bulk: true do |t|
t.remove_index [:utm_link_visit_id, :order_id], unique: true
t.remove_index :order_id
t.rename :order_id, :purchase_id... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20240803055758_drop_processed_audios.rb | Ruby | mit | 8,966 | main | 584 | # frozen_string_literal: true
class DropProcessedAudios < ActiveRecord::Migration[7.1]
def up
drop_table :processed_audios
end
def down
create_table "processed_audios", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.integer "product_file_id"
t.str... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20261119011939_add_pkce_to_doorkeeper.rb | Ruby | mit | 8,966 | main | 245 | # frozen_string_literal: true
class AddPkceToDoorkeeper < ActiveRecord::Migration[7.1]
def change
change_table :oauth_access_grants, bulk: true do |t|
t.string :code_challenge
t.string :code_challenge_method
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20210621081510_add_content_updated_at_to_product_index.rb | Ruby | mit | 8,966 | main | 293 | # frozen_string_literal: true
class AddContentUpdatedAtToProductIndex < ActiveRecord::Migration[6.1]
def up
EsClient.indices.put_mapping(
index: Link.index_name,
body: {
properties: {
content_updated_at: { type: "date" },
}
}
)
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20230125164938_add_price_change_attributes_to_variants.rb | Ruby | mit | 8,966 | main | 301 | # frozen_string_literal: true
class AddPriceChangeAttributesToVariants < ActiveRecord::Migration[7.0]
def change
change_table :base_variants, bulk: true do |t|
t.date :subscription_price_change_effective_date
t.text :subscription_price_change_message, size: :long
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20190413210021_sync_indexes_with_production.rb | Ruby | mit | 8,966 | main | 4,874 | # frozen_string_literal: true
class SyncIndexesWithProduction < ActiveRecord::Migration
def up
# ==========
# Following indexes exist in dev, not in production
# ==========
create_index_unless_exists(:affiliate_credits, :link_id, :index_affiliate_credits_on_link_id)
create_index_unless_exists(:a... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20210511062447_create_affiliate_requests.rb | Ruby | mit | 8,966 | main | 505 | # frozen_string_literal: true
class CreateAffiliateRequests < ActiveRecord::Migration[6.1]
def change
create_table :affiliate_requests do |t|
t.references :seller, type: :bigint, null: false, index: true
t.string :name, null: false, limit: 100
t.string :email, null: false
t.text :promotio... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20190110094142_remove_index_and_add_unique_index_to_product_reviews.rb | Ruby | mit | 8,966 | main | 694 | # 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, :purchase... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20241206205100_add_is_call_and_is_alive_to_products_index.rb | Ruby | mit | 8,966 | main | 327 | # frozen_string_literal: true
class AddIsCallAndIsAliveToProductsIndex < ActiveRecord::Migration[7.1]
def up
EsClient.indices.put_mapping(
index: Link.index_name,
body: {
properties: {
is_call: { type: "boolean" },
is_alive: { type: "boolean" },
}
}
)
e... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20130612230657_remove_stripe_fingerpring_uniqueness.rb | Ruby | mit | 8,966 | main | 257 | # frozen_string_literal: true
class RemoveStripeFingerpringUniqueness < ActiveRecord::Migration
def change
remove_index :credit_cards, name: "index_credit_cards_on_stripe_fingerprint_unique"
add_index :credit_cards, :stripe_fingerprint
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20210402124642_add_free_trial_properties_to_products.rb | Ruby | mit | 8,966 | main | 249 | # 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 |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20200726140318_add_paypal_billing_agreement_id_to_credit_card.rb | Ruby | mit | 8,966 | main | 275 | # frozen_string_literal: true
class AddPaypalBillingAgreementIdToCreditCard < ActiveRecord::Migration[6.0]
def up
add_column :credit_cards, :paypal_billing_agreement_id, :string
end
def down
remove_column :credit_cards, :paypal_billing_agreement_id
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20210713094050_create_stripe_apple_pay_domains.rb | Ruby | mit | 8,966 | main | 347 | # 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.ti... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20230708062915_add_purchasing_power_parity_limit_to_users.rb | Ruby | mit | 8,966 | main | 226 | # frozen_string_literal: true
class AddPurchasingPowerParityLimitToUsers < ActiveRecord::Migration[7.0]
def change
change_table :users, bulk: true do |t|
t.integer :purchasing_power_parity_limit
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20201221103409_remove_event_test_path_assignments.rb | Ruby | mit | 8,966 | main | 723 | # frozen_string_literal: true
class RemoveEventTestPathAssignments < ActiveRecord::Migration[6.0]
def up
drop_table :event_test_path_assignments
end
def down
create_table "event_test_path_assignments", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
t.integer ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20120518183456_add_attachment_preview_to_link.rb | Ruby | mit | 8,966 | main | 532 | # 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... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20140707165730_add_charge_processor_id_to_credit_card.rb | Ruby | mit | 8,966 | main | 308 | # frozen_string_literal: true
class AddChargeProcessorIdToCreditCard < ActiveRecord::Migration
def up
add_column :credit_cards, :charge_processor_id, :string
CreditCard.update_all({ charge_processor_id: "stripe" })
end
def down
remove_column :credit_cards, :charge_processor_id
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20121129193009_added_card_brand_to_bins.rb | Ruby | mit | 8,966 | main | 201 | # frozen_string_literal: true
class AddedCardBrandToBins < ActiveRecord::Migration
def up
add_column :bins, :card_brand, :string
end
def down
remove_column :bins, :card_brand
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20111109223341_create_assets.rb | Ruby | mit | 8,966 | main | 291 | # frozen_string_literal: true
class CreateAssets < ActiveRecord::Migration
def change
create_table :assets do |t|
t.string :blob_key
t.string :file_name
t.integer :date
t.string :unique_permalink
t.string :file_type
t.timestamps
end
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20190803211425_add_shown_on_profile_to_product_taggings.rb | Ruby | mit | 8,966 | main | 321 | # frozen_string_literal: true
class AddShownOnProfileToProductTaggings < ActiveRecord::Migration
def up
add_column :product_taggings, :shown_on_profile, :boolean
change_column_default :product_taggings, :shown_on_profile, true
end
def down
remove_column :product_taggings, :shown_on_profile
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20150917174836_ensure_call_to_action_limits_are_correct.rb | Ruby | mit | 8,966 | main | 275 | # frozen_string_literal: true
class EnsureCallToActionLimitsAreCorrect < ActiveRecord::Migration
def change
change_column(:installments, :call_to_action_text, :string, limit: 2083)
change_column(:installments, :call_to_action_url, :string, limit: 2083)
end
end |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20150528180752_add_url_to_product_files_archive.rb | Ruby | mit | 8,966 | main | 456 | # frozen_string_literal: true
class AddUrlToProductFilesArchive < ActiveRecord::Migration
def change
add_column :product_files_archives, :url, :string
remove_column :product_files_archives, :zip_archive_file_file_name
remove_column :product_files_archives, :zip_archive_file_content_type
remove_column... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | db/migrate/20250103124729_create_utm_links.rb | Ruby | mit | 8,966 | main | 802 | # frozen_string_literal: true
class CreateUtmLinks < ActiveRecord::Migration[7.1]
def change
create_table :utm_links do |t|
t.references :seller, null: false
t.string :title, null: false
t.string :target_resource_type, null: false
t.string :target_resource_id
t.string :permalink, nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.