Add flipper gem and database migration/tables
This commit is contained in:
		
							parent
							
								
									9048052318
								
							
						
					
					
						commit
						287adbd365
					
				
							
								
								
									
										2
									
								
								Gemfile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Gemfile
									
									
									
									
									
								
							| @ -40,6 +40,8 @@ gem 'net-ldap' | |||||||
| gem "rqrcode", "~> 2.0" | gem "rqrcode", "~> 2.0" | ||||||
| gem 'rails-settings-cached', '~> 2.8.3' | gem 'rails-settings-cached', '~> 2.8.3' | ||||||
| gem 'pagy', '~> 6.0', '>= 6.0.2' | gem 'pagy', '~> 6.0', '>= 6.0.2' | ||||||
|  | gem 'flipper' | ||||||
|  | gem 'flipper-active_record' | ||||||
| 
 | 
 | ||||||
| # HTTP requests | # HTTP requests | ||||||
| gem 'faraday' | gem 'faraday' | ||||||
|  | |||||||
| @ -128,6 +128,11 @@ GEM | |||||||
|       ruby2_keywords (>= 0.0.4) |       ruby2_keywords (>= 0.0.4) | ||||||
|     faraday-net_http (3.0.2) |     faraday-net_http (3.0.2) | ||||||
|     ffi (1.15.5) |     ffi (1.15.5) | ||||||
|  |     flipper (0.28.0) | ||||||
|  |       concurrent-ruby (< 2) | ||||||
|  |     flipper-active_record (0.28.0) | ||||||
|  |       activerecord (>= 4.2, < 8) | ||||||
|  |       flipper (~> 0.28.0) | ||||||
|     fugit (1.7.2) |     fugit (1.7.2) | ||||||
|       et-orbi (~> 1, >= 1.2.7) |       et-orbi (~> 1, >= 1.2.7) | ||||||
|       raabro (~> 1.4) |       raabro (~> 1.4) | ||||||
| @ -374,6 +379,8 @@ DEPENDENCIES | |||||||
|   factory_bot_rails |   factory_bot_rails | ||||||
|   faker |   faker | ||||||
|   faraday |   faraday | ||||||
|  |   flipper | ||||||
|  |   flipper-active_record | ||||||
|   importmap-rails |   importmap-rails | ||||||
|   jbuilder (~> 2.7) |   jbuilder (~> 2.7) | ||||||
|   letter_opener |   letter_opener | ||||||
|  | |||||||
							
								
								
									
										22
									
								
								db/migrate/20230523120753_create_flipper_tables.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								db/migrate/20230523120753_create_flipper_tables.rb
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,22 @@ | |||||||
|  | class CreateFlipperTables < ActiveRecord::Migration[7.0] | ||||||
|  |   def self.up | ||||||
|  |     create_table :flipper_features do |t| | ||||||
|  |       t.string :key, null: false | ||||||
|  |       t.timestamps null: false | ||||||
|  |     end | ||||||
|  |     add_index :flipper_features, :key, unique: true | ||||||
|  | 
 | ||||||
|  |     create_table :flipper_gates do |t| | ||||||
|  |       t.string :feature_key, null: false | ||||||
|  |       t.string :key, null: false | ||||||
|  |       t.string :value | ||||||
|  |       t.timestamps null: false | ||||||
|  |     end | ||||||
|  |     add_index :flipper_gates, [:feature_key, :key, :value], unique: true | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def self.down | ||||||
|  |     drop_table :flipper_gates | ||||||
|  |     drop_table :flipper_features | ||||||
|  |   end | ||||||
|  | end | ||||||
							
								
								
									
										18
									
								
								db/schema.rb
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								db/schema.rb
									
									
									
									
									
								
							| @ -10,7 +10,7 @@ | |||||||
| # | # | ||||||
| # It's strongly recommended that you check this file into your version control system. | # It's strongly recommended that you check this file into your version control system. | ||||||
| 
 | 
 | ||||||
| ActiveRecord::Schema[7.0].define(version: 2023_04_03_135149) do | ActiveRecord::Schema[7.0].define(version: 2023_05_23_120753) do | ||||||
|   create_table "donations", force: :cascade do |t| |   create_table "donations", force: :cascade do |t| | ||||||
|     t.integer "user_id" |     t.integer "user_id" | ||||||
|     t.integer "amount_sats" |     t.integer "amount_sats" | ||||||
| @ -23,6 +23,22 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_03_135149) do | |||||||
|     t.index ["user_id"], name: "index_donations_on_user_id" |     t.index ["user_id"], name: "index_donations_on_user_id" | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|  |   create_table "flipper_features", force: :cascade do |t| | ||||||
|  |     t.string "key", null: false | ||||||
|  |     t.datetime "created_at", null: false | ||||||
|  |     t.datetime "updated_at", null: false | ||||||
|  |     t.index ["key"], name: "index_flipper_features_on_key", unique: true | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   create_table "flipper_gates", force: :cascade do |t| | ||||||
|  |     t.string "feature_key", null: false | ||||||
|  |     t.string "key", null: false | ||||||
|  |     t.string "value" | ||||||
|  |     t.datetime "created_at", null: false | ||||||
|  |     t.datetime "updated_at", null: false | ||||||
|  |     t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|   create_table "invitations", force: :cascade do |t| |   create_table "invitations", force: :cascade do |t| | ||||||
|     t.string "token" |     t.string "token" | ||||||
|     t.integer "user_id" |     t.integer "user_id" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user