Support ALTER SCHEMA ... RENAME TO ... in declarative schema changer (doc link).
It should include tests in the schema changer testing suites (end-to-end, scbuild, scplan), in a logic test (if not already exists), and enable it in the schemachange workload.
To support this statement, we should probably only need to create a file in the "declarative schema changer builder layer", the entrance point for processing any DDL statement in declarative schema changer. For example, we'd like to add an entry first for this statement (ALTER SCHEMA) in here, and then create a file in scbuild/internal/ (maybe called alter_schema.go) in which we would try to implement the functionality of a ALTER SCHEMA ... RENAME TO. You will probably need logic there to see if it's a statement other than RENAME TO (recall: we also have other stmt like ALTER SCHEMA ... OWNER TO ...), and if so, return an scerror.unimplemented error so we could fall back to legacy schema changer.
Support
ALTER SCHEMA ... RENAME TO ...
in declarative schema changer (doc link).It should include tests in the schema changer testing suites (end-to-end, scbuild, scplan), in a logic test (if not already exists), and enable it in the
schemachange
workload.To support this statement, we should probably only need to create a file in the "declarative schema changer builder layer", the entrance point for processing any DDL statement in declarative schema changer. For example, we'd like to add an entry first for this statement (
ALTER SCHEMA
) in here, and then create a file inscbuild/internal/
(maybe calledalter_schema.go
) in which we would try to implement the functionality of aALTER SCHEMA ... RENAME TO
. You will probably need logic there to see if it's a statement other thanRENAME TO
(recall: we also have other stmt likeALTER SCHEMA ... OWNER TO ...
), and if so, return anscerror.unimplemented
error so we could fall back to legacy schema changer.The code documentation that describes the various schemachanger packages is at: https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/schemachanger/doc.go
Epic: CRDB-25360
Jira issue: CRDB-33999