Skip to content

Exclude "guest" schema in schema dumper #1208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading