dbsrgits / dbix-class-schema-loader

Official GitHub remote for git.shadowcat.co.uk DBIx-Class-Schema-Loader.git
http://dbix-class.org/
11 stars 34 forks source link

Text fields cannot be indexed without truncation in mysql [rt.cpan.org #68734] #48

Open rabbiveesh opened 1 year ago

rabbiveesh commented 1 year ago

Migrated from rt.cpan.org#68734 (status was 'open')

Requestors:

From michael.du-pont@dress-for-less.de on 2011-06-10 10:12:31 :

This table cannot be round tripped via the 

CREATE TABLE GOOD (
  sometext text NOT NULL,
  UNIQUE KEY sometext2 ( sometext(150))
) 

dbicdump -o dump_directory=./lib  -o
components='["InflateColumn::DateTime"]' DFL::Schema::TEST
"dbi:mysql:database=$1:host=dbslave2" UID PWD '{ overwrite_modifications
=> 1, quote_char => "`" }'

Produces :

__PACKAGE__->add_unique_constraint("sometext2", [ "sometext"]);

This produces bad sql when deployed:

my $schema = Test::Schema::TEST->connect("dbi:mysql:dbname=${db}",
$user, $pass);
    $schema->create_ddl_dir(['MySQL', 'SQLite', 'PostgreSQL'],
                '0.1',
                './sql/'
    );

    $schema->deploy({ add_drop_table => 1});

############

CREATE TABLE BAD (
  sometext text NOT NULL,
  UNIQUE KEY sometext2 ( sometext)
) 

From ribasushi@leporine.io on 2011-06-10 10:23:23 :

Adding dependency on the sqlt support ticket - without having an sqlt
infrastructure to consume index lengths, there's no point of adding this
to dbic.