2
Message format for ALTER TABLE commands.
4
package drizzled.message;
5
option optimize_for = SPEED;
7
option java_package = "org.drizzle.messages";
8
option java_outer_classname = "AlterTableMessage";
11
optional string catalog = 1;
12
required string schema = 2;
13
required string name = 3;
21
required BuildMethod build_method = 4 [default = BUILD_DEFAULT];
23
required bool ignore = 5 [ default = false ];
25
message AlterTableOperation {
27
/* Currently, the only valid DISCARD_TABLESPACE or IMPORT_TABLESPACE
28
ALTER TABLE operation is as the first and only operation */
29
DISCARD_TABLESPACE = 0;
30
IMPORT_TABLESPACE = 1;
31
DROP_KEY = 2; /* uses drop_name */
32
DROP_COLUMN = 3; /* uses drop_name */
33
DROP_FOREIGN_KEY = 4; /* uses drop_name */
36
required Operation operation = 1;
38
optional string drop_name = 2;;
41
repeated AlterTableOperation operations = 6;
44
required string to_schema = 1;
45
required string to_name = 2;
48
message AlterKeysOnOff {
49
required bool enable = 1;
52
/* RenameTable and AlterKeysOnOff are weird as they can only exist once,
53
and only exist as what the last one in a ALTER TABLE statement does.
54
i.e. from SQL the following is valid:
55
CREATE TABLE t1 (a int);
56
CREATE TABLE t2 (a int);
57
ALTER TABLE t1 RENAME t2, RENAME t3;
58
(t1 is renamed to t3 without error or warning).
59
We can argue if this is insanity or not, but that's current behaviour.
61
optional RenameTable rename = 7;
62
optional AlterKeysOnOff alter_keys_onoff = 8;