You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 20081015005018_create_ip_bans.rb
    path of file: ./repos/moebooru/db/migrate
    
    the code of the file until where you have to start completion: class CreateIpBans < ActiveRecord::Migration[5.1]
  def self.up
    execute <<-EOS
      CREATE TABLE ip_bans (
        id SERIAL PRIMARY KEY,
        created_at timestamp NOT NULL DEFAULT now(),
        expires_at timestamp,
        ip_addr inet NOT NULL,
        reason text NOT
    
  def self.up
    execute <<-EOS
      CREATE TABLE ip_bans (
        id SERIAL PRIMARY KEY,
        created_at timestamp NOT NULL DEFAULT now(),
        expires_at timestamp,
        ip_addr inet NOT NULL,
        reason text NOT NULL,
        banned_by integer NOT NULL
      )
    EOS
    add_foreign_key "ip_bans", "banned_by", "users", "id", on_delete: :cascade
    add_index :ip_bans, :ip_addr
  end