Permalink
Browse files

survey database schema

  • Loading branch information...
1 parent 8d96253 commit 335727b2a529b4437eecdab0b657a424222f4c91 Kieren Diment committed Feb 21, 2010
Binary file not shown.
@@ -0,0 +1,21 @@
+package PerlSurvey::Schema;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Schema';
+
+__PACKAGE__->load_namespaces(
+ result_namespace => 'Result',
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-21 17:16:24
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:07DhQcd7m7knlU56xyQTqg
+
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
@@ -0,0 +1,123 @@
+package PerlSurvey::Schema::Result::Answer;
+
+# 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__->load_components("TimeStamp");
+
+=head1 NAME
+
+PerlSurvey::Schema::Result::Answer
+
+=cut
+
+__PACKAGE__->table("answers");
+
+=head1 ACCESSORS
+
+=head2 id
+
+ data_type: integer
+ default_value: undef
+ is_nullable: 1
+ size: undef
+
+=head2 user
+
+ data_type: integer
+ default_value: undef
+ is_foreign_key: 1
+ is_nullable: 1
+ size: undef
+
+=head2 field
+
+ data_type: varchar
+ default_value: undef
+ is_foreign_key: 1
+ is_nullable: 1
+ size: 128
+
+=head2 answer
+
+ data_type: text
+ default_value: undef
+ is_nullable: 1
+ size: undef
+
+=head2 time_entered
+
+ data_type: char
+ default_value: current_timestamp
+ is_nullable: 1
+ size: 19
+
+=head2 useragent
+
+ data_type: text
+ default_value: undef
+ is_nullable: 1
+ size: undef
+
+=cut
+
+__PACKAGE__->add_columns(
+ "id",
+ {
+ data_type => "integer",
+ default_value => undef,
+ is_nullable => 1,
+ size => undef,
+ },
+ "user",
+ {
+ data_type => "integer",
+ default_value => undef,
+ is_foreign_key => 1,
+ is_nullable => 1,
+ size => undef,
+ },
+ "field",
+ {
+ data_type => "varchar",
+ default_value => undef,
+ is_foreign_key => 1,
+ is_nullable => 1,
+ size => 128,
+ },
+ "answer",
+ {
+ data_type => "text",
+ default_value => undef,
+ is_nullable => 1,
+ size => undef,
+ },
+ "time_entered",
+ {
+ data_type => "char",
+ default_value => \"current_timestamp",
+ is_nullable => 1,
+ size => 19,
+ },
+ "useragent",
+ {
+ data_type => "text",
+ default_value => undef,
+ is_nullable => 1,
+ size => undef,
+ },
+);
+__PACKAGE__->set_primary_key("id");
+
+
+# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-21 19:23:31
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZsueKFbUuCBVFX/1no1Ijg
+
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
@@ -0,0 +1,137 @@
+package PerlSurvey::Schema::Result::Question;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+
+=head1 NAME
+
+PerlSurvey::Schema::Result::Question
+
+=cut
+
+__PACKAGE__->table("questions");
+
+=head1 ACCESSORS
+
+=head2 field
+
+ data_type: varchar
+ default_value: undef
+ is_nullable: 1
+ size: 128
+
+=head2 title
+
+ data_type: text
+ default_value: undef
+ is_nullable: 1
+ size: undef
+
+=head2 type
+
+ data_type: text
+ default_value: undef
+ is_nullable: 1
+ size: undef
+
+=head2 validation
+
+ data_type: text
+ default_value: undef
+ is_nullable: 1
+ size: undef
+
+=head2 section
+
+ data_type: integer
+ default_value: undef
+ is_foreign_key: 1
+ is_nullable: 1
+ size: undef
+
+=cut
+
+__PACKAGE__->add_columns(
+ "field",
+ {
+ data_type => "varchar",
+ default_value => undef,
+ is_nullable => 1,
+ size => 128,
+ },
+ "title",
+ {
+ data_type => "text",
+ default_value => undef,
+ is_nullable => 1,
+ size => undef,
+ },
+ "type",
+ {
+ data_type => "text",
+ default_value => undef,
+ is_nullable => 1,
+ size => undef,
+ },
+ "validation",
+ {
+ data_type => "text",
+ default_value => undef,
+ is_nullable => 1,
+ size => undef,
+ },
+ "section",
+ {
+ data_type => "integer",
+ default_value => undef,
+ is_foreign_key => 1,
+ is_nullable => 1,
+ size => undef,
+ },
+);
+__PACKAGE__->set_primary_key("field");
+
+=head1 RELATIONS
+
+=head2 section
+
+Type: belongs_to
+
+Related object: L<PerlSurvey::Schema::Result::Section>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "section",
+ "PerlSurvey::Schema::Result::Section",
+ { id => "section" },
+ { join_type => "LEFT" },
+);
+
+=head2 answers
+
+Type: has_many
+
+Related object: L<PerlSurvey::Schema::Result::Answer>
+
+=cut
+
+__PACKAGE__->has_many(
+ "answers",
+ "PerlSurvey::Schema::Result::Answer",
+ { "foreign.field" => "self.field" },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-21 17:15:23
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TZWCrS5b/XmoTj9/mpey6g
+
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
@@ -0,0 +1,78 @@
+package PerlSurvey::Schema::Result::Section;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+
+=head1 NAME
+
+PerlSurvey::Schema::Result::Section
+
+=cut
+
+__PACKAGE__->table("sections");
+
+=head1 ACCESSORS
+
+=head2 id
+
+ data_type: integer
+ default_value: undef
+ is_nullable: 1
+ size: undef
+
+=head2 title
+
+ data_type: text
+ default_value: undef
+ is_nullable: 1
+ size: undef
+
+=cut
+
+__PACKAGE__->add_columns(
+ "id",
+ {
+ data_type => "integer",
+ default_value => undef,
+ is_nullable => 1,
+ size => undef,
+ },
+ "title",
+ {
+ data_type => "text",
+ default_value => undef,
+ is_nullable => 1,
+ size => undef,
+ },
+);
+__PACKAGE__->set_primary_key("id");
+
+=head1 RELATIONS
+
+=head2 questions
+
+Type: has_many
+
+Related object: L<PerlSurvey::Schema::Result::Question>
+
+=cut
+
+__PACKAGE__->has_many(
+ "questions",
+ "PerlSurvey::Schema::Result::Question",
+ { "foreign.section" => "self.id" },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-21 17:15:23
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iHeluErrk5uqhV0MnYXr3Q
+
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
Oops, something went wrong.

0 comments on commit 335727b

Please sign in to comment.