@@ -55,11 +55,11 @@ abstract class TableSchema {
55
55
];
56
56
57
57
public const UNIQUE_INDICES = [
58
- Option::TABLE => ['name ' => 'UNIQ_options ' , 'unique ' => true , 'columns ' => ['poll_id ' , 'poll_option_text ' , 'timestamp ' ]],
58
+ Option::TABLE => ['name ' => 'UNIQ_options ' , 'unique ' => true , 'columns ' => ['poll_id ' , 'poll_option_hash ' , 'timestamp ' ]],
59
59
Log::TABLE => ['name ' => 'UNIQ_unprocessed ' , 'unique ' => true , 'columns ' => ['processed ' , 'poll_id ' , 'user_id ' , 'message_id ' ]],
60
60
Subscription::TABLE => ['name ' => 'UNIQ_subscription ' , 'unique ' => true , 'columns ' => ['poll_id ' , 'user_id ' ]],
61
61
Share::TABLE => ['name ' => 'UNIQ_shares ' , 'unique ' => true , 'columns ' => ['poll_id ' , 'user_id ' ]],
62
- Vote::TABLE => ['name ' => 'UNIQ_votes ' , 'unique ' => true , 'columns ' => ['poll_id ' , 'user_id ' , 'vote_option_text ' ]],
62
+ Vote::TABLE => ['name ' => 'UNIQ_votes ' , 'unique ' => true , 'columns ' => ['poll_id ' , 'user_id ' , 'vote_option_hash ' ]],
63
63
Preferences::TABLE => ['name ' => 'UNIQ_preferences ' , 'unique ' => true , 'columns ' => ['user_id ' ]],
64
64
Watch::TABLE => ['name ' => 'UNIQ_watch ' , 'unique ' => true , 'columns ' => ['poll_id ' , 'table ' , 'session_id ' ]],
65
65
];
@@ -172,6 +172,7 @@ abstract class TableSchema {
172
172
'id ' => ['type ' => Types::BIGINT , 'options ' => ['autoincrement ' => true , 'notnull ' => true , 'length ' => 20 ]],
173
173
'poll_id ' => ['type ' => Types::BIGINT , 'options ' => ['notnull ' => true , 'default ' => 0 , 'length ' => 20 ]],
174
174
'poll_option_text ' => ['type ' => Types::STRING , 'options ' => ['notnull ' => false , 'default ' => '' , 'length ' => 1024 ]],
175
+ 'poll_option_hash ' => ['type ' => Types::STRING , 'options ' => ['notnull ' => false , 'default ' => '' , 'length ' => 256 ]],
175
176
'timestamp ' => ['type ' => Types::BIGINT , 'options ' => ['notnull ' => true , 'default ' => 0 , 'length ' => 20 ]],
176
177
'duration ' => ['type ' => Types::BIGINT , 'options ' => ['notnull ' => true , 'default ' => 0 , 'length ' => 20 ]],
177
178
'order ' => ['type ' => Types::BIGINT , 'options ' => ['notnull ' => true , 'default ' => 0 , 'length ' => 20 ]],
@@ -185,6 +186,7 @@ abstract class TableSchema {
185
186
'user_id ' => ['type ' => Types::STRING , 'options ' => ['notnull ' => false , 'default ' => '' , 'length ' => 256 ]],
186
187
'vote_option_id ' => ['type ' => Types::BIGINT , 'options ' => ['notnull ' => true , 'default ' => 0 , 'length ' => 20 ]],
187
188
'vote_option_text ' => ['type ' => Types::STRING , 'options ' => ['notnull ' => false , 'default ' => '' , 'length ' => 1024 ]],
189
+ 'vote_option_hash ' => ['type ' => Types::STRING , 'options ' => ['notnull ' => false , 'default ' => '' , 'length ' => 256 ]],
188
190
'vote_answer ' => ['type ' => Types::STRING , 'options ' => ['notnull ' => false , 'default ' => '' , 'length ' => 64 ]],
189
191
],
190
192
Comment::TABLE => [
0 commit comments