Skip to content
This repository was archived by the owner on Jul 26, 2020. It is now read-only.

Commit 679d4c3

Browse files
committed
Add incremental id to accounts
1 parent 0bea415 commit 679d4c3

18 files changed

+3733
-51
lines changed

lib/GMS/Schema.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Do nothing for now.
7171

7272
sub install_defaults { }
7373

74-
our $VERSION = 4;
74+
our $VERSION = 5;
7575

7676
# You can replace this text with custom content, and it will be preserved on regeneration
7777
1;

lib/GMS/Schema/Result/Account.pm

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ __PACKAGE__->table("accounts");
2525
2626
=head2 id
2727
28+
data_type: 'integer'
29+
is_auto_increment: 1
30+
is_nullable: 0
31+
sequence: 'accounts_id_seq'
32+
33+
=head2 uuid
34+
2835
data_type: 'varchar'
2936
is_nullable: 0
3037
size: 9
@@ -44,8 +51,15 @@ __PACKAGE__->table("accounts");
4451
=cut
4552

4653
__PACKAGE__->add_columns(
47-
"id",
54+
"uuid",
4855
{ data_type => "varchar", is_nullable => 0, size => 9 },
56+
"id",
57+
{
58+
data_type => "integer",
59+
is_auto_increment => 1,
60+
is_nullable => 0,
61+
sequence => "accounts_id_seq",
62+
},
4963
"accountname",
5064
{ data_type => "varchar", is_nullable => 1, size => 32 },
5165
"dropped",
@@ -64,6 +78,21 @@ __PACKAGE__->add_columns(
6478

6579
__PACKAGE__->set_primary_key("id");
6680

81+
=head1 UNIQUE CONSTRAINTS
82+
83+
=head2 C<unique_uuid>
84+
85+
=over 4
86+
87+
=item * L</uuid>
88+
89+
=back
90+
91+
=cut
92+
93+
94+
__PACKAGE__->add_unique_constraint("unique_uuid", ["uuid"]);
95+
6796
=head1 RELATIONS
6897
6998
=head2 channel_namespace_changes

lib/GMS/Schema/Result/ChannelNamespaceChange.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ __PACKAGE__->table("channel_namespace_changes");
6565
6666
=head2 changed_by
6767
68-
data_type: 'text'
68+
data_type: 'integer'
6969
is_foreign_key: 1
7070
is_nullable: 0
7171
@@ -114,7 +114,7 @@ __PACKAGE__->add_columns(
114114
original => { default_value => \"now()" },
115115
},
116116
"changed_by",
117-
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
117+
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
118118
"change_type",
119119
{
120120
data_type => "enum",
@@ -192,7 +192,7 @@ __PACKAGE__->belongs_to(
192192
"changed_by",
193193
"GMS::Schema::Result::Account",
194194
{ id => "changed_by" },
195-
{ is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
195+
{ is_deferrable => 1, on_delete => "RESTRICT", on_update => "CASCADE" },
196196
);
197197

198198
=head2 channel_namespace

lib/GMS/Schema/Result/ChannelRequest.pm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,9 @@ __PACKAGE__->table("channel_requests");
6464
6565
=head2 target
6666
67-
data_type: 'varchar'
67+
data_type: 'integer'
6868
is_foreign_key: 1
6969
is_nullable: 1
70-
size: 32
7170
7271
=head2 request_data
7372
@@ -117,7 +116,7 @@ __PACKAGE__->add_columns(
117116
"channel",
118117
{ data_type => "varchar", is_nullable => 0, size => 50 },
119118
"target",
120-
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 32 },
119+
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
121120
"request_data",
122121
{ data_type => "text", is_nullable => 1 },
123122
"active_change",
@@ -244,7 +243,7 @@ __PACKAGE__->belongs_to(
244243
is_deferrable => 1,
245244
join_type => "LEFT",
246245
on_delete => "NO ACTION",
247-
on_update => "NO ACTION",
246+
on_update => "CASCADE",
248247
},
249248
);
250249

lib/GMS/Schema/Result/ChannelRequestChange.pm

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ __PACKAGE__->table("channel_request_changes");
4545
4646
=head2 changed_by
4747
48-
data_type: 'text'
48+
data_type: 'integer'
4949
is_foreign_key: 1
5050
is_nullable: 0
51-
original: {data_type => "varchar"}
5251
5352
=head2 status
5453
@@ -82,10 +81,9 @@ __PACKAGE__->add_columns(
8281
},
8382
"changed_by",
8483
{
85-
data_type => "text",
84+
data_type => "integer",
8685
is_foreign_key => 1,
8786
is_nullable => 0,
88-
original => { data_type => "varchar" },
8987
},
9088
"status",
9189
{
@@ -141,7 +139,7 @@ __PACKAGE__->belongs_to(
141139
"changed_by",
142140
"GMS::Schema::Result::Account",
143141
{ id => "changed_by" },
144-
{ is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
142+
{ is_deferrable => 1, on_delete => "RESTRICT", on_update => "CASCADE" },
145143
);
146144

147145
=head2 channel_request

lib/GMS/Schema/Result/CloakChange.pm

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,15 @@ __PACKAGE__->table("cloak_changes");
4646
4747
=head2 target
4848
49-
data_type: 'varchar'
49+
data_type: 'integer'
5050
is_foreign_key: 1
5151
is_nullable: 0
52-
size: 32
5352
5453
=head2 requestor
5554
56-
data_type: 'varchar'
55+
data_type: 'integer'
5756
is_foreign_key: 1
5857
is_nullable: 0
59-
size: 32
6058
6159
=head2 cloak
6260
@@ -94,9 +92,9 @@ __PACKAGE__->add_columns(
9492
sequence => "cloak_changes_id_seq",
9593
},
9694
"target",
97-
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 32 },
95+
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
9896
"requestor",
99-
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 32 },
97+
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
10098
"cloak",
10199
{ data_type => "varchar", is_nullable => 0, size => 63 },
102100
"active_change",
@@ -205,7 +203,7 @@ __PACKAGE__->belongs_to(
205203
"requestor",
206204
"GMS::Schema::Result::Account",
207205
{ id => "requestor" },
208-
{ is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
206+
{ is_deferrable => 1, on_delete => "RESTRICT", on_update => "CASCADE" },
209207
);
210208

211209
=head2 target

lib/GMS/Schema/Result/CloakChangeChange.pm

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ __PACKAGE__->table("cloak_change_changes");
4545
4646
=head2 changed_by
4747
48-
data_type: 'text'
48+
data_type: 'integer'
4949
is_foreign_key: 1
5050
is_nullable: 0
51-
original: {data_type => "varchar"}
5251
5352
=head2 status
5453
@@ -82,10 +81,9 @@ __PACKAGE__->add_columns(
8281
},
8382
"changed_by",
8483
{
85-
data_type => "text",
84+
data_type => "integer",
8685
is_foreign_key => 1,
8786
is_nullable => 0,
88-
original => { data_type => "varchar" },
8987
},
9088
"status",
9189
{
@@ -141,7 +139,7 @@ __PACKAGE__->belongs_to(
141139
"changed_by",
142140
"GMS::Schema::Result::Account",
143141
{ id => "changed_by" },
144-
{ is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
142+
{ is_deferrable => 1, on_delete => "RESTRICT", on_update => "CASCADE" },
145143
);
146144

147145
=head2 cloak_change

lib/GMS/Schema/Result/CloakNamespaceChange.pm

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ __PACKAGE__->table("cloak_namespace_changes");
5151
5252
=head2 changed_by
5353
54-
data_type: 'text'
54+
data_type: 'integer'
5555
is_foreign_key: 1
5656
is_nullable: 0
57-
original: {data_type => "varchar"}
5857
5958
=head2 change_type
6059
@@ -102,10 +101,9 @@ __PACKAGE__->add_columns(
102101
},
103102
"changed_by",
104103
{
105-
data_type => "text",
104+
data_type => "integer",
106105
is_foreign_key => 1,
107106
is_nullable => 0,
108-
original => { data_type => "varchar" },
109107
},
110108
"change_type",
111109
{
@@ -184,7 +182,7 @@ __PACKAGE__->belongs_to(
184182
"changed_by",
185183
"GMS::Schema::Result::Account",
186184
{ id => "changed_by" },
187-
{ is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
185+
{ is_deferrable => 1, on_delete => "RESTRICT", on_update => "CASCADE" },
188186
);
189187

190188
=head2 cloak_namespace

lib/GMS/Schema/Result/Contact.pm

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ __PACKAGE__->table("contacts");
3232
3333
=head2 account_id
3434
35-
data_type: 'text'
35+
data_type: 'integer'
3636
is_foreign_key: 1
3737
is_nullable: 0
38-
original: {data_type => "varchar"}
3938
4039
=head2 active_change
4140
@@ -74,10 +73,9 @@ __PACKAGE__->add_columns(
7473
},
7574
"account_id",
7675
{
77-
data_type => "text",
76+
data_type => "integer",
7877
is_foreign_key => 1,
7978
is_nullable => 0,
80-
original => { data_type => "varchar" },
8179
},
8280
"active_change",
8381
{
@@ -146,7 +144,7 @@ __PACKAGE__->belongs_to(
146144
"account",
147145
"GMS::Schema::Result::Account",
148146
{ id => "account_id" },
149-
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "NO ACTION" },
147+
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
150148
);
151149

152150
=head2 active_change

lib/GMS/Schema/Result/ContactChange.pm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ __PACKAGE__->table("contact_changes");
4545
4646
=head2 changed_by
4747
48-
data_type: 'text'
48+
data_type: 'integer'
4949
is_foreign_key: 1
5050
is_nullable: 0
51-
original: {data_type => "varchar"}
5251
5352
=head2 name
5453
@@ -106,10 +105,9 @@ __PACKAGE__->add_columns(
106105
},
107106
"changed_by",
108107
{
109-
data_type => "text",
108+
data_type => "integer",
110109
is_foreign_key => 1,
111110
is_nullable => 0,
112-
original => { data_type => "varchar" },
113111
},
114112
"name",
115113
{ data_type => "varchar", is_nullable => 0, size => 255 },

lib/GMS/Schema/Result/GroupChange.pm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ __PACKAGE__->table("group_changes");
4545
4646
=head2 changed_by
4747
48-
data_type: 'text'
48+
data_type: 'integer'
4949
is_foreign_key: 1
5050
is_nullable: 0
51-
original: {data_type => "varchar"}
5251
5352
=head2 change_type
5453
@@ -112,10 +111,9 @@ __PACKAGE__->add_columns(
112111
},
113112
"changed_by",
114113
{
115-
data_type => "text",
114+
data_type => "integer",
116115
is_foreign_key => 1,
117116
is_nullable => 0,
118-
original => { data_type => "varchar" },
119117
},
120118
"change_type",
121119
{

lib/GMS/Schema/Result/GroupContactChange.pm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ __PACKAGE__->table("group_contact_changes");
6262
6363
=head2 changed_by
6464
65-
data_type: 'text'
65+
data_type: 'integer'
6666
is_foreign_key: 1
6767
is_nullable: 0
68-
original: {data_type => "varchar"}
6968
7069
=head2 affected_change
7170
@@ -121,10 +120,9 @@ __PACKAGE__->add_columns(
121120
},
122121
"changed_by",
123122
{
124-
data_type => "text",
123+
data_type => "integer",
125124
is_foreign_key => 1,
126125
is_nullable => 0,
127-
original => { data_type => "varchar" },
128126
},
129127
"affected_change",
130128
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },

lib/GMS/Schema/Result/UserRole.pm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ __PACKAGE__->table("user_roles");
2525
2626
=head2 account_id
2727
28-
data_type: 'text'
28+
data_type: 'integer'
2929
is_foreign_key: 1
3030
is_nullable: 0
31-
original: {data_type => "varchar"}
3231
3332
=head2 role_id
3433
@@ -41,7 +40,7 @@ __PACKAGE__->table("user_roles");
4140
__PACKAGE__->add_columns(
4241
"account_id",
4342
{
44-
data_type => "text",
43+
data_type => "integer",
4544
is_foreign_key => 1,
4645
is_nullable => 0,
4746
original => { data_type => "varchar" },

0 commit comments

Comments
 (0)