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: 09142010220946_add_fts_to_pools.rb
    path of file: ./repos/moebooru/db/migrate
    
    the code of the file until where you have to start completion: class AddFtsToPools < ActiveRecord::Migration[5.1]
  def self.up
    execute "ALTER TABLE pools ADD COLUMN search_index tsvector"

    execute """
    CREATE OR REPLACE FUNCTION pools_search_update_trigger() RETURNS trigger AS $$
    BEGIN
      new.search_index := to_tsvector('pg_catalog.english', new.name || ' ' || new.description);
      RETURN new;
    END
    $$ LANGUAGE plpgsql;
    """

    execute "CREATE TRIGGER trg_po
    
  def self.up
    execute "ALTER TABLE pools ADD COLUMN search_index tsvector"

    execute """
    CREATE OR REPLACE FUNCTION pools_search_update_trigger() RETURNS trigger AS $$
    BEGIN
      new.search_index := to_tsvector('pg_catalog.english', new.name || ' ' || new.description);
      RETURN new;
    END
    $$ LANGUAGE plpgsql;
    """

    execute "CREATE TRIGGER trg_pools_search_update BEFORE INSERT OR UPDATE ON pools
    FOR EACH ROW EXECUTE PROCEDURE pools_search_update_trigger()"
    execute "UPDATE pools set name=name"
    execute "CREATE INDEX post_search_idx on pools using gin(search_index)"
  end