Skip to content

Commit

Permalink
Exclude "guest" schmea in schema dumper (#1208)
Browse files Browse the repository at this point in the history
Co-authored-by: Jesse vonBergen <[email protected]>
  • Loading branch information
jvon1904 and Jesse vonBergen authored Jul 26, 2024
1 parent b62e362 commit 4b8da98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def schema_names
FROM sys.schemas
WHERE
name NOT LIKE 'db_%' AND
name NOT IN ('INFORMATION_SCHEMA', 'sys')
name NOT IN ('INFORMATION_SCHEMA', 'sys', 'guest')
SQL

query_values(sql, "SCHEMA")
Expand Down
4 changes: 4 additions & 0 deletions test/cases/schema_dumper_test_sqlserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ class SchemaDumperTestSQLServer < ActiveRecord::TestCase

# Only generate non-default schemas. Default schema is 'dbo'.
assert_not_includes generated_schema, 'create_schema "dbo"'
assert_not_includes generated_schema, 'create_schema "db_owner"'
assert_not_includes generated_schema, 'create_schema "INFORMATION_SCHEMA"'
assert_not_includes generated_schema, 'create_schema "sys"'
assert_not_includes generated_schema, 'create_schema "guest"'
assert_includes generated_schema, 'create_schema "test"'
assert_includes generated_schema, 'create_schema "test2"'

Expand Down

0 comments on commit 4b8da98

Please sign in to comment.