Add support for FASP data sharing (#34415)
This commit is contained in:
		
							
								
								
									
										18
									
								
								db/migrate/20241213130230_create_fasp_subscriptions.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								db/migrate/20241213130230_create_fasp_subscriptions.rb
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
class CreateFaspSubscriptions < ActiveRecord::Migration[7.2]
 | 
			
		||||
  def change
 | 
			
		||||
    create_table :fasp_subscriptions do |t|
 | 
			
		||||
      t.string :category, null: false
 | 
			
		||||
      t.string :subscription_type, null: false
 | 
			
		||||
      t.integer :max_batch_size, null: false
 | 
			
		||||
      t.integer :threshold_timeframe
 | 
			
		||||
      t.integer :threshold_shares
 | 
			
		||||
      t.integer :threshold_likes
 | 
			
		||||
      t.integer :threshold_replies
 | 
			
		||||
      t.references :fasp_provider, null: false, foreign_key: true
 | 
			
		||||
 | 
			
		||||
      t.timestamps
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										15
									
								
								db/migrate/20250103131909_create_fasp_backfill_requests.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								db/migrate/20250103131909_create_fasp_backfill_requests.rb
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
class CreateFaspBackfillRequests < ActiveRecord::Migration[7.2]
 | 
			
		||||
  def change
 | 
			
		||||
    create_table :fasp_backfill_requests do |t|
 | 
			
		||||
      t.string :category, null: false
 | 
			
		||||
      t.integer :max_count, null: false, default: 100
 | 
			
		||||
      t.string :cursor
 | 
			
		||||
      t.boolean :fulfilled, null: false, default: false
 | 
			
		||||
      t.references :fasp_provider, null: false, foreign_key: true
 | 
			
		||||
 | 
			
		||||
      t.timestamps
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										27
									
								
								db/schema.rb
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								db/schema.rb
									
									
									
									
									
								
							@@ -445,6 +445,17 @@ ActiveRecord::Schema[8.0].define(version: 2025_04_28_095029) do
 | 
			
		||||
    t.index ["domain"], name: "index_email_domain_blocks_on_domain", unique: true
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  create_table "fasp_backfill_requests", force: :cascade do |t|
 | 
			
		||||
    t.string "category", null: false
 | 
			
		||||
    t.integer "max_count", default: 100, null: false
 | 
			
		||||
    t.string "cursor"
 | 
			
		||||
    t.boolean "fulfilled", default: false, null: false
 | 
			
		||||
    t.bigint "fasp_provider_id", null: false
 | 
			
		||||
    t.datetime "created_at", null: false
 | 
			
		||||
    t.datetime "updated_at", null: false
 | 
			
		||||
    t.index ["fasp_provider_id"], name: "index_fasp_backfill_requests_on_fasp_provider_id"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  create_table "fasp_debug_callbacks", force: :cascade do |t|
 | 
			
		||||
    t.bigint "fasp_provider_id", null: false
 | 
			
		||||
    t.string "ip", null: false
 | 
			
		||||
@@ -471,6 +482,20 @@ ActiveRecord::Schema[8.0].define(version: 2025_04_28_095029) do
 | 
			
		||||
    t.index ["base_url"], name: "index_fasp_providers_on_base_url", unique: true
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  create_table "fasp_subscriptions", force: :cascade do |t|
 | 
			
		||||
    t.string "category", null: false
 | 
			
		||||
    t.string "subscription_type", null: false
 | 
			
		||||
    t.integer "max_batch_size", null: false
 | 
			
		||||
    t.integer "threshold_timeframe"
 | 
			
		||||
    t.integer "threshold_shares"
 | 
			
		||||
    t.integer "threshold_likes"
 | 
			
		||||
    t.integer "threshold_replies"
 | 
			
		||||
    t.bigint "fasp_provider_id", null: false
 | 
			
		||||
    t.datetime "created_at", null: false
 | 
			
		||||
    t.datetime "updated_at", null: false
 | 
			
		||||
    t.index ["fasp_provider_id"], name: "index_fasp_subscriptions_on_fasp_provider_id"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  create_table "favourites", force: :cascade do |t|
 | 
			
		||||
    t.datetime "created_at", precision: nil, null: false
 | 
			
		||||
    t.datetime "updated_at", precision: nil, null: false
 | 
			
		||||
@@ -1322,7 +1347,9 @@ ActiveRecord::Schema[8.0].define(version: 2025_04_28_095029) do
 | 
			
		||||
  add_foreign_key "custom_filter_statuses", "statuses", on_delete: :cascade
 | 
			
		||||
  add_foreign_key "custom_filters", "accounts", on_delete: :cascade
 | 
			
		||||
  add_foreign_key "email_domain_blocks", "email_domain_blocks", column: "parent_id", on_delete: :cascade
 | 
			
		||||
  add_foreign_key "fasp_backfill_requests", "fasp_providers"
 | 
			
		||||
  add_foreign_key "fasp_debug_callbacks", "fasp_providers"
 | 
			
		||||
  add_foreign_key "fasp_subscriptions", "fasp_providers"
 | 
			
		||||
  add_foreign_key "favourites", "accounts", name: "fk_5eb6c2b873", on_delete: :cascade
 | 
			
		||||
  add_foreign_key "favourites", "statuses", name: "fk_b0e856845e", on_delete: :cascade
 | 
			
		||||
  add_foreign_key "featured_tags", "accounts", on_delete: :cascade
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user