Commit | Line | Data |
4f4fd192 |
1 | use MooseX::Declare; |
2 | class SQL::Translator::Object::Column { |
0874db2d |
3 | use MooseX::Types::Moose qw(Bool HashRef Int Maybe Str); |
4f4fd192 |
4 | use SQL::Translator::Types qw(Trigger); |
5 | extends 'SQL::Translator::Object'; |
6 | |
7 | has 'name' => ( |
8 | is => 'rw', |
9 | isa => Str, |
10 | required => 1 |
11 | ); |
12 | |
13 | has 'data_type' => ( |
14 | is => 'rw', |
81429cb9 |
15 | isa => Str, |
16 | required => 1 |
17 | ); |
18 | |
19 | has 'sql_data_type' => ( |
20 | is => 'rw', |
4f4fd192 |
21 | isa => Int, |
22 | required => 1 |
23 | ); |
24 | |
25 | has 'size' => ( |
26 | is => 'rw', |
27 | isa => Maybe[Int], |
28 | required => 1 |
29 | ); |
30 | |
31 | has 'is_nullable' => ( |
32 | is => 'rw', |
33 | isa => Bool, |
34 | required => 1, |
35 | default => 1 |
36 | ); |
37 | |
4f4fd192 |
38 | has 'default_value' => ( |
39 | is => 'rw', |
40 | isa => Maybe[Str], |
41 | ); |
42 | |
2225e251 |
43 | has 'comments' => ( |
4f4fd192 |
44 | is => 'rw', |
45 | isa => Maybe[Str], |
46 | ); |
0874db2d |
47 | |
81429cb9 |
48 | has 'is_auto_increment' => ( |
49 | is => 'rw', |
50 | isa => Bool, |
51 | required => 1, |
52 | default => 0 |
53 | ); |
54 | |
0874db2d |
55 | has 'is_primary_key' => ( |
56 | is => 'rw', |
57 | isa => Bool, |
58 | default => 0 |
59 | ); |
4f4fd192 |
60 | |
61 | has 'trigger' => ( |
62 | is => 'rw', |
63 | isa => Trigger, |
64 | ); |
0874db2d |
65 | |
66 | has 'extra' => ( |
67 | is => 'rw', |
68 | isa => HashRef, |
69 | auto_deref => 1, |
70 | ); |
4f4fd192 |
71 | } |