root/lang/perl/DBIx-Class-ProxyTable/lib/DBIx/Class/ProxyTable/AutoCreateTable/mysql.pm @ 13119

Revision 13119, 0.6 kB (checked in by nekokak, 7 years ago)

もろもろ調整

Line 
1package DBIx::Class::ProxyTable::AutoCreateTable::mysql;
2use strict;
3use warnings;
4
5sub _get_table {
6    my ($class, $rs, $new_table) = @_;
7
8    my $base_table = $rs->result_source->schema->source_registrations->{$rs->result_source->source_name}->name;
9    my $sth = $rs->result_source->schema->storage->dbh->prepare("show create table $base_table");
10    $sth->execute;
11    my $table = $sth->fetchrow_hashref;
12    $table->{'Create Table'} =~ s/$base_table/$new_table/;
13    return $table->{'Create Table'};
14}
151;
16
17__END__
18
19=head1 NAME
20
21DBIx::Class::ProxyTable::AutoCreateTable::mysql - auto create mysql table
22
23=head1 METHOD
24
25=head2 _get_table
26
Note: See TracBrowser for help on using the browser.