Initial auth example, something is a bit wonky with the session?
[catagits/Web-Simple.git] / examples / auth / lib / AuthApp / Schema / Result / User.pm
diff --git a/examples/auth/lib/AuthApp/Schema/Result/User.pm b/examples/auth/lib/AuthApp/Schema/Result/User.pm
new file mode 100644 (file)
index 0000000..aa865b1
--- /dev/null
@@ -0,0 +1,27 @@
+package AuthApp::Schema::Result::User;
+
+use base 'DBIx::Class::Core';
+
+__PACKAGE__->load_components(qw(InflateColumn::Authen::Passphrase));
+__PACKAGE__->table('users');
+__PACKAGE__->add_columns(
+    id => {
+        data_type => 'integer',
+        is_auto_increment => 1,
+    },
+    username => {
+        data_type => 'TINYTEXT',
+    },
+    password => {
+        data_type => 'varchar',
+        size => 255,
+        inflate_passphrase => 'rfc2307',
+    },
+    );
+
+__PACKAGE__->set_primary_key('id');
+__PACKAGE__->add_unique_constraint('username' => ['username']);
+
+1;
+
+