| 1 | use utf8; | ||
| 2 | package Rapi::Blog::DB::Result::PostCategory; | ||
| 3 | |||
| 4 | # Created by DBIx::Class::Schema::Loader | ||
| 5 | # DO NOT MODIFY THE FIRST PART OF THIS FILE | ||
| 6 | |||
| 7 | use strict; | ||
| 8 | use warnings; | ||
| 9 | |||
| 10 | use Moose; | ||
| 11 | use MooseX::NonMoose; | ||
| 12 | use MooseX::MarkAsMethods autoclean => 1; | ||
| 13 | extends 'DBIx::Class::Core'; | ||
| 14 | __PACKAGE__->load_components("InflateColumn::DateTime"); | ||
| 15 | __PACKAGE__->table("post_category"); | ||
| 16 | __PACKAGE__->add_columns( | ||
| 17 | "id", | ||
| 18 | { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, | ||
| 19 | "post_id", | ||
| 20 | { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, | ||
| 21 | "category_name", | ||
| 22 | { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 64 }, | ||
| 23 | ); | ||
| 24 | __PACKAGE__->set_primary_key("id"); | ||
| 25 | __PACKAGE__->belongs_to( | ||
| 26 | "category_name", | ||
| 27 | "Rapi::Blog::DB::Result::Category", | ||
| 28 | { name => "category_name" }, | ||
| 29 | { is_deferrable => 0, on_delete => "RESTRICT", on_update => "RESTRICT" }, | ||
| 30 | ); | ||
| 31 | __PACKAGE__->belongs_to( | ||
| 32 | "post", | ||
| 33 | "Rapi::Blog::DB::Result::Post", | ||
| 34 | { id => "post_id" }, | ||
| 35 | { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" }, | ||
| 36 | ); | ||
| 37 | |||
| 38 | |||
| 39 | # Created by DBIx::Class::Schema::Loader v0.07045 @ 2017-08-20 20:36:08 | ||
| 40 | # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gMnowO0yVdoLTVDPASrqBw | ||
| 41 | |||
| 42 | |||
| 43 | # You can replace this text with custom code or comments, and it will be preserved on regeneration | ||
| 44 | __PACKAGE__->meta->make_immutable; | ||
| 45 | 1; |