public function actionTypeTemplate($schemaName = null)
    {
        if ($schemaName === null) {
            $schemaName = 'public';
        }
        return [
            'exists' => (new Query())
                ->select('typname')
                ->from('pg_type')
                ->where('typname=:value', [':value' => 'action_type'])->exists($this->db),
            'up' => "CREATE TYPE $schemaName.action_type AS ENUM ('INSERT', 'SELECT', 'UPDATE', 'DELETE', 'TRUNCATE')",
            'down' => "DROP TYPE $schemaName.action_type",
        ];
    }
public function actionTypeTemplate($schemaName = null)
    {
        if ($schemaName === null) {
            $schemaName = 'public';
        }
        return [
            'exists' => (new Query())
                ->select('typname')
                ->from('pg_type')
                ->where('typname=:value', [':value' => 'action_type'])->exists($this->db),
            'up' => "CREATE TYPE $schemaName.action_type AS ENUM ('INSERT', 'SELECT', 'UPDATE', 'DELETE', 'TRUNCATE')",
            'down' => "DROP TYPE $schemaName.action_type",
        ];
    }
public function actionTypeTemplate ( $ schemaName = null ) { if ( $ schemaName === null ) { $ schemaName = 'public' ; } return [ 'exists' => ( new Query ( ) ) -> select ( 'typname' ) -> from ( 'pg_type' ) -> where ( 'typname=:value' , [ ':value' => 'action_type' ] ) -> exists ( $ this -> db ) , 'up' => "CREATE TYPE $schemaName.action_type AS ENUM ('INSERT', 'SELECT', 'UPDATE', 'DELETE', 'TRUNCATE')" , 'down' => "DROP TYPE $schemaName.action_type" , ] ; }
Returns two queries, to create and destroy the action db type.
@param string $schemaName if null, defaults to 'public'
@return array with three keys: exists(boolean), up(string) and down(string)
Returns two queries to create and destroy the action db type .