#!/usr/bin/perl
use strict;
use warnings;
use DBIx::Class::Schema::Loader qw/make_schema_at/;
make_schema_at(
"Mydb::Schema",
{debug => 0, dump_directory => "../db/",
generate_pod => 0,},
["dbi:mysql:mydb:localhost:3306", 'mydb', 'password'],
);
MySQL은 나의 테이블 이름 people
,하지만 난이 코드를 실행하면, 생성 된 클래스가 Mydb::Schema::Result::Person
라는 :
$ cat Mydb/Schema/Result/Person.pm
use utf8;
package Mydb::Schema::Result::Person;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
use strict;
use warnings;
use base 'DBIx::Class::Core';
__PACKAGE__->table("people");
__PACKAGE__->add_columns(
"pplid",
{
data_type => "smallint",
extra => { unsigned => 1 },
is_auto_increment => 1,
is_nullable => 0,
},
...
...
"사람"이 "사람"으로 변환되는 이유는 무엇입니까?
당신이나 다른 누군가가 쓴 스크립트입니다. DBIx :: Class의 일부가 아닙니다. 당신은 아마 거기에 매핑을 정의했습니다. – simbabque
@simbabque 모든 스크립트는'DBIx :: Class :: Schema :: Loader :: make_schema_at'를 호출합니다. DBIx :: Class는 이것을하고 있습니다. OP가 만든 매핑이 아닙니다. – ThisSuitIsBlackNot
@ThisSuitIsBlack 그 주석을 쓸 때 코드는 아직 질문에 없습니다. 나는 복수형에 대해서 알고 있지만 단수로는 가질 수없는 단어를 위해 그것을 기대하고 싶습니다. – simbabque