The document discusses different methods for connecting Ruby on Rails applications to Apache. It recommends method 3, using Apache with mongrel_cluster and mod_proxy. This allows Apache to recognize and proxy requests to the Rails application running on mongrel, without needing other proxying software. It avoids issues the other methods had with permissions and access.
12. Schemaファイルの生成
② スキーマファイルが
自動生成される
① make_schema.pl
を実行する
13. Schemaファイルの生成(コード)
#!/usr/bin/perl
use strict;
use warnings;
use FindBin::libs qw{ export base=syscommon };
use MyLibs::Common::DB::Config;
use DBIx::Class::Schema::Loader qw( make_schema_at );
# スキーマファイルの出力先
my $dump_directory = 'C:/workspace/syscommon';
# データベース名を指定
my $dbname = "tclipers";
my ($conf_obj, $db_conf);
$conf_obj = MyLibs::Common::DB::Config->new();
$conf_obj->use_db("mysql");
$db_conf = $conf_obj->get_db_config();
make_schema_at(
'MyLibs::Common::DB::Schema',
{relationships => 1, debug => 1, dump_directory => $dump_directory},
["dbi:$db_conf->{dbms}:dbname=$dbname;host=$db_conf->{host}", $db_conf->{user}, $db_conf->{pass}]
);
14. 生成されたSchemaファイル
package MyLibs::Common::DB::Schema::Tclipers;
use strict;
use warnings;
use base 'DBIx::Class';
__PACKAGE__->load_components("Core");
__PACKAGE__->table("tclipers");
__PACKAGE__->add_columns(
"id",
{ data_type => "INT", default_value => undef, is_nullable => 0, size => 11 },
…
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint("url_hash_index", ["url_hash"]);
# Created by DBIx::Class::Schema::Loader v0.04006 @ 2009-07-12 01:49:00
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YCPFZVg0EvGhZEbLwsh2AA
# You can replace this text with custom content, and it will be preserved on regeneration
1;