| 1 |
package migrator |
| 2 |
|
| 3 |
import ( |
| 4 |
"database/sql" |
| 5 |
) |
| 6 |
|
| 7 |
// TableType table type implements TableType interface |
| 8 |
type TableType struct { |
| 9 |
SchemaValue string |
| 10 |
NameValue string |
| 11 |
TypeValue string |
| 12 |
CommentValue sql.NullString |
| 13 |
} |
| 14 |
|
| 15 |
// Schema returns the schema of the table. |
| 16 |
func (ct TableType) Schema() string { |
| 17 |
return ct.SchemaValue |
| 18 |
} |
| 19 |
|
| 20 |
// Name returns the name of the table. |
| 21 |
func (ct TableType) Name() string { |
| 22 |
return ct.NameValue |
| 23 |
} |
| 24 |
|
| 25 |
// Type returns the type of the table. |
| 26 |
func (ct TableType) Type() string { |
| 27 |
return ct.TypeValue |
| 28 |
} |
| 29 |
|
| 30 |
// Comment returns the comment of current table. |
| 31 |
func (ct TableType) Comment() (comment string, ok bool) { |
| 32 |
return ct.CommentValue.String, ct.CommentValue.Valid |
| 33 |
} |