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 2 commits
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/Producer/Oracle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ sub create_index {
$index_name ? quote($index_name, $qf): '',
'ON',
quote($index->table, $qt),
'(' . join( ', ', map { quote($_, $qf) } $index->fields ) . ")$index_options"
'(' . join( ', ', map { quote($_, $qf) } $index->field_names ) . ")$index_options"
);
}

Expand Down
2 changes: 1 addition & 1 deletion t/45db2-producer.t
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ my $index = $table->add_index(name => 'myindex', fields => ['foo']);
my ($def) = SQL::Translator::Producer::DB2::create_index($index);
is($def, 'CREATE INDEX myindex ON mytable ( foo );', 'index created');

my $index2 = $table->add_index(name => 'myindex', fields => [ { name => 'foo', size => 15 } ]);
my $index2 = $table->add_index(name => 'myindex', fields => [ { name => 'foo', prefix_length => 15 } ]);
my ($def2) = SQL::Translator::Producer::DB2::create_index($index);
is($def2, 'CREATE INDEX myindex ON mytable ( foo );', 'index created');

Expand Down
2 changes: 1 addition & 1 deletion t/47postgres-producer.t
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ is($view2_sql1, $view2_sql_replace, 'correct "CREATE OR REPLACE VIEW" SQL 2');
}

{
my $index = $table->add_index(name => 'myindex', fields => [ { name => 'foo', size => 20 } ]);
my $index = $table->add_index(name => 'myindex', fields => [ { name => 'foo', prefix_length => 20 } ]);
my ($def) = SQL::Translator::Producer::PostgreSQL::create_index($index);
is($def, "CREATE INDEX myindex on foobar (foo)", 'index created');
($def) = SQL::Translator::Producer::PostgreSQL::create_index($index, $quote);
Expand Down
4 changes: 2 additions & 2 deletions t/55-oracle-producer.t
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ use SQL::Translator::Producer::Oracle;

is_deeply(
$index1_def,
[ 'CREATE INDEX myfooindex on table1 (foo)',
'CREATE INDEX mybarindex on table1 (bar)'
[ 'CREATE INDEX myfooindex ON table1 (foo)',
'CREATE INDEX mybarindex ON table1 (bar)'
],
'correct "CREATE INDEX" SQL'
);
Expand Down