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: 20150605192639_add_postgrest_auth_table.rb
    path of file: ./repos/catarse/db/migrate
    
    the code of the file until where you have to start completion: class AddPostgrestAuthTable < ActiveRecord::Migration
  def up
    execute <<-SQL
      CREATE SCHEMA postgrest;

      CREATE TABLE postgrest.auth (
        id text NOT NULL,
        rolnam
    
  def up
    execute <<-SQL
      CREATE SCHEMA postgrest;

      CREATE TABLE postgrest.auth (
        id text NOT NULL,
        rolname name NOT NULL,
        pass character(60) NOT NULL,
        CONSTRAINT auth_pkey PRIMARY KEY (id)
      ) WITH ( OIDS=FALSE );

      CREATE FUNCTION postgrest.check_role_exists() RETURNS trigger
          LANGUAGE plpgsql
          AS $$
      begin 
      if not exists (select 1 from pg_roles as r where r.rolname = new.rolname) then
         raise foreign_key_violation using message = 'Cannot create user with unknown role: ' || new.rolname;
         return null;
       end if;
       return new;
      end