~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/table.proto

  • Committer: Stewart Smith
  • Date: 2010-07-12 11:56:38 UTC
  • mto: (1638.10.42)
  • mto: This revision was merged to the branch mainline in revision 1701.
  • Revision ID: stewart@flamingspork.com-20100712115638-em5kq1bgpl6xcs95
Add FOREIGN KEY constraints to the table proto. set them, add code in statement_transform for them, which means we now get foreign keys in the transaction_log. We don't go changing any existing code manipulating foreign key data structures and instead just create our own (minimal changes FTW).

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
  }
35
35
 
36
36
  message ForeignKeyConstraint {
37
 
    required string name = 1;
38
 
    required Field dependent = 2;
39
 
    required Field parent = 3;
40
 
    /** @TODO Finish this off... */
 
37
    optional string name = 1;
 
38
    repeated string column_names = 2;
 
39
    required string references_table_name = 3;
 
40
    repeated string references_columns = 4;
 
41
 
 
42
    enum ForeignKeyMatchOption {
 
43
      MATCH_UNDEFINED = 0;
 
44
      MATCH_FULL = 1;
 
45
      MATCH_PARTIAL = 2;
 
46
      MATCH_SIMPLE = 3;
 
47
    }
 
48
    required ForeignKeyMatchOption match = 5;
 
49
 
 
50
    enum ForeignKeyOption {
 
51
      OPTION_UNDEF = 0;
 
52
      OPTION_RESTRICT = 1;
 
53
      OPTION_CASCADE = 2;
 
54
      OPTION_SET_NULL = 3;
 
55
      OPTION_NO_ACTION = 4;
 
56
      OPTION_DEFAULT = 5;
 
57
    }
 
58
 
 
59
    required ForeignKeyOption update_option = 6 [ default = OPTION_UNDEF ];
 
60
    required ForeignKeyOption delete_option = 7 [ default = OPTION_UNDEF ];
41
61
  }
42
62
 
43
63
  message Field {