Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add index length option for MySQL #68

Merged
merged 27 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
28a7ca4
Add index length option for MySQL
Sep 2, 2015
065748e
Merge branch 'master' into index-length
Sep 29, 2015
9a738f7
Name index field "size" to "prefix_length", hide plain/refy fieldness
castaway Nov 6, 2015
0d987f2
Merge remote-tracking branch 'upstream/master' into index-length
Feb 5, 2019
cf6c180
Merge remote-tracking branch 'upstream/master' into index-length
abeverley Sep 15, 2022
1213f8e
Merge remote-tracking branch 'castaway/index-length' into index-length
abeverley Sep 15, 2022
b56de88
Fix failing tests
abeverley Sep 15, 2022
71ac26d
Fix failing test
abeverley Sep 15, 2022
e48176e
Fix incorrect index names in YAML producer
abeverley Sep 15, 2022
373a011
Change missed key to new prefix_length name
abeverley Sep 16, 2022
2e52bd6
Fix index lengths not being produced in YAML
abeverley Sep 16, 2022
f3a8e27
Merge remote-tracking branch 'upstream/master' into index-length
abeverley Jun 18, 2023
1c413ca
Fix failing tests
abeverley Jun 18, 2023
a10be29
Fix warnings when running tests
abeverley Jun 18, 2023
d064562
Enable other options in index field names
abeverley Jun 19, 2023
aff5e8d
chore: rollback the fields -> field_names changes in the producers
rabbiveesh Jun 19, 2023
cbd2d4f
feat(IndexField): upgrade all index fields to use a new IndexField ob…
rabbiveesh Jun 21, 2023
f08bf6a
feat(MySQL): upgrade producer to support prefix_length w/ new objects
rabbiveesh Jun 21, 2023
e267a95
fix: oops, actually put in the sort routine :face_palm:
rabbiveesh Jun 21, 2023
1a0a314
fix(parse_list_arg): don't stringify the tings!
rabbiveesh Jun 21, 2023
a26cff0
fix: handle weird YAML double objecting
rabbiveesh Jun 21, 2023
bfc7565
Write index extra properties in YAML producer
abeverley Jul 22, 2023
905fa34
Fix failing test
abeverley Jul 22, 2023
79bfc70
Fix failing lint test
abeverley Jul 22, 2023
28d3d2f
chore: finish up here
rabbiveesh Nov 25, 2023
a2d2e6c
Merge branch 'master' into index-length
rabbiveesh Nov 25, 2023
3aa5cd8
Merge pull request #2 from dbsrgits/index-length
abeverley Nov 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/SQL/Translator/Schema/Index.pm
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ around equals => sub {
foreach my $otherField ($other->fields) {
my $name = ref $otherField ? $otherField->{name} : $otherField;
$name = uc($name) if $case_insensitive;
$otherFields{$name} = ref $otherField ? $otherField->{size} : -1; # -1 == no length. Easier comparison.
$otherFields{$name} = ref $otherField ? $otherField->{prefix_length} : -1; # -1 == no length. Easier comparison.
}
foreach my $selfField ($self->fields) { # check for self fields in hash
my ($name, $size) = ref $selfField ? ($selfField->{name}, $selfField->{prefix_length}) : ($selfField, -1);
Expand Down
4 changes: 2 additions & 2 deletions t/13schema.t
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,13 @@ require_ok( 'SQL::Translator::Schema' );

# Same indexes with different lengths
my $index4 = SQL::Translator::Schema::Index->new(
name => "sized", fields => [ { name => 'forename', size => 20} ]
name => "sized", fields => [ { name => 'forename', prefix_length => 20} ]
);
ok( !$index3->equals($index4), "2 different indexes return false on equals() function (index length different)" );

# Identical indexes with lengths
my $index5 = SQL::Translator::Schema::Index->new(
name => "sized", fields => [ { name => 'forename', size => 15} ]
name => "sized", fields => [ { name => 'forename', prefix_length => 15} ]
);
ok( $index3->equals($index5), "2 identical indexes return true on equals() (with index length)" );

Expand Down