Change account_id non-nullable in lists (#5979)
This commit is contained in:
		
							parent
							
								
									d5f4baf720
								
							
						
					
					
						commit
						a90fa13235
					
				
					 3 changed files with 10 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -4,7 +4,7 @@
 | 
			
		|||
# Table name: lists
 | 
			
		||||
#
 | 
			
		||||
#  id         :integer          not null, primary key
 | 
			
		||||
#  account_id :integer
 | 
			
		||||
#  account_id :integer          not null
 | 
			
		||||
#  title      :string           default(""), not null
 | 
			
		||||
#  created_at :datetime         not null
 | 
			
		||||
#  updated_at :datetime         not null
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
 | 
			
		||||
 | 
			
		||||
class ChangeAccountIdNonnullableInLists < ActiveRecord::Migration[5.1]
 | 
			
		||||
  def change
 | 
			
		||||
    change_column_null :lists, :account_id, false
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -10,7 +10,7 @@
 | 
			
		|||
#
 | 
			
		||||
# It's strongly recommended that you check this file into your version control system.
 | 
			
		||||
 | 
			
		||||
ActiveRecord::Schema.define(version: 20171130000000) do
 | 
			
		||||
ActiveRecord::Schema.define(version: 20171201000000) do
 | 
			
		||||
 | 
			
		||||
  # These are extensions that must be enabled in order to support this database
 | 
			
		||||
  enable_extension "plpgsql"
 | 
			
		||||
| 
						 | 
				
			
			@ -209,7 +209,7 @@ ActiveRecord::Schema.define(version: 20171130000000) do
 | 
			
		|||
  end
 | 
			
		||||
 | 
			
		||||
  create_table "lists", force: :cascade do |t|
 | 
			
		||||
    t.bigint "account_id"
 | 
			
		||||
    t.bigint "account_id", null: false
 | 
			
		||||
    t.string "title", default: "", null: false
 | 
			
		||||
    t.datetime "created_at", null: false
 | 
			
		||||
    t.datetime "updated_at", null: false
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue