SetVersionCol sets the column to use as the Version field. By default the "Version" field is used. Returns the column found, or panics if the struct does not contain a field matching this name. Automatically calls ResetSql() to ensure SQL statements are regenerated.
(field string)
| 162 | // |
| 163 | // Automatically calls ResetSql() to ensure SQL statements are regenerated. |
| 164 | func (t *TableMap) SetVersionCol(field string) *ColumnMap { |
| 165 | c := t.ColMap(field) |
| 166 | t.version = c |
| 167 | t.ResetSql() |
| 168 | return c |
| 169 | } |
| 170 | |
| 171 | // SqlForCreateTable gets a sequence of SQL commands that will create |
| 172 | // the specified table and any associated schema |