1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/schema
Ryuta Kamizono 1b68ead8f8 Use squiggly heredoc to strip odd indentation in the executed SQL
Before:

```
LOG:  execute <unnamed>:             SELECT t.oid, t.typname
                    FROM pg_type as t
                    WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'bool')

LOG:  execute <unnamed>:               SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
                      FROM pg_type as t
                      LEFT JOIN pg_range as r ON oid = rngtypid
                      WHERE
                        t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'text', 'varchar', 'char', 'name', 'bpchar', 'bool', 'bit', 'varbit', 'timestamptz', 'date', 'money', 'bytea', 'point', 'hstore', 'json', 'jsonb', 'cidr', 'inet', 'uuid', 'xml', 'tsvector', 'macaddr', 'citext', 'ltree', 'interval', 'path', 'line', 'polygon', 'circle', 'lseg', 'box', 'time', 'timestamp', 'numeric')
                        OR t.typtype IN ('r', 'e', 'd')
                        OR t.typinput::varchar = 'array_in'
                        OR t.typelem != 0

LOG:  statement: SHOW TIME ZONE
LOG:  statement: SELECT 1
LOG:  execute <unnamed>:               SELECT COUNT(*)
                      FROM pg_class c
                      LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
                      WHERE c.relkind IN ('r','v','m') -- (r)elation/table, (v)iew, (m)aterialized view
                      AND c.relname = 'accounts'
                      AND n.nspname = ANY (current_schemas(false))
```

After:

```
LOG:  execute <unnamed>: SELECT t.oid, t.typname
        FROM pg_type as t
        WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'bool')

LOG:  execute <unnamed>: SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
        FROM pg_type as t
        LEFT JOIN pg_range as r ON oid = rngtypid
                      WHERE
                        t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'text', 'varchar', 'char', 'name', 'bpchar', 'bool', 'bit', 'varbit', 'timestamptz', 'date', 'money', 'bytea', 'point', 'hstore', 'json', 'jsonb', 'cidr', 'inet', 'uuid', 'xml', 'tsvector', 'macaddr', 'citext', 'ltree', 'interval', 'path', 'line', 'polygon', 'circle', 'lseg', 'box', 'time', 'timestamp', 'numeric')
                        OR t.typtype IN ('r', 'e', 'd')
                        OR t.typinput::varchar = 'array_in'
                        OR t.typelem != 0

LOG:  statement: SHOW TIME ZONE
LOG:  statement: SELECT 1
LOG:  execute <unnamed>: SELECT COUNT(*)
        FROM pg_class c
        LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
        WHERE c.relkind IN ('r','v','m') -- (r)elation/table, (v)iew, (m)aterialized view
        AND c.relname = 'accounts'
        AND n.nspname = ANY (current_schemas(false))
```
2018-11-22 19:43:53 +09:00
..
mysql2_specific_schema.rb Use squiggly heredoc to strip odd indentation in the executed SQL 2018-11-22 19:43:53 +09:00
oracle_specific_schema.rb Use squiggly heredoc to strip odd indentation in the executed SQL 2018-11-22 19:43:53 +09:00
postgresql_specific_schema.rb Enable Layout/EmptyLinesAroundBlockBody to reduce review cost in the future 2018-07-12 21:29:48 +09:00
schema.rb Exercise HABTM fixtures with foreign key constraints 2018-10-30 11:08:41 +09:00
sqlite_specific_schema.rb add mysql and sqlite3 default test 2018-09-01 22:09:01 -04:00