diff --git a/lib/IdPAccountManager/DB.pm b/lib/IdPAccountManager/DB.pm
new file mode 100644
index 0000000000000000000000000000000000000000..1f412e42878b624ff4ee0b49217078ce1c066bd0
--- /dev/null
+++ b/lib/IdPAccountManager/DB.pm
@@ -0,0 +1,18 @@
+package IdPAccountManager::DB;
+
+use strict;
+
+use base 'Rose::DB';
+
+__PACKAGE__->use_private_registry;
+
+__PACKAGE__->register_db
+(
+  connect_options => { AutoCommit => 1, ChopBlanks => 1 },
+  driver          => 'mysql',
+  dsn             => 'dbi:mysql:dbname=idp_account_manager;host=localhost',
+  password        => 'root',
+  username        => 'root',
+);
+
+1;
diff --git a/lib/IdPAccountManager/DB/Object.pm b/lib/IdPAccountManager/DB/Object.pm
new file mode 100644
index 0000000000000000000000000000000000000000..b95451c794eebec34e4647f577bbd69c11e8c3b5
--- /dev/null
+++ b/lib/IdPAccountManager/DB/Object.pm
@@ -0,0 +1,11 @@
+package IdPAccountManager::DB::Object;
+
+use base 'Rose::DB::Object';
+
+use IdPAccountManager::DB;
+
+sub init_db {
+    IdPAccountManager::DB->new();
+}
+
+1;
diff --git a/lib/IdPAccountManager/Data/Authenticationtoken.pm b/lib/IdPAccountManager/Data/Authenticationtoken.pm
new file mode 100644
index 0000000000000000000000000000000000000000..fbb75003ccbfd3e413e54d3089cf80fa71454a81
--- /dev/null
+++ b/lib/IdPAccountManager/Data/Authenticationtoken.pm
@@ -0,0 +1,27 @@
+package IdPAccountManager::Data::Authenticationtoken;
+
+use strict;
+
+use base 'IdPAccountManager::DB::Object';
+
+__PACKAGE__->meta->setup(
+    table   => 'authenticationtokens',
+
+    columns => [
+        id            => { type => 'bigserial', not_null => 1 },
+        token         => { type => 'varchar', length => 50, not_null => 1 },
+        email_address => { type => 'varchar', length => 200, not_null => 1 },
+        sp_entityid   => { type => 'varchar', length => 200, not_null => 1 },
+        creation_date => { type => 'integer' },
+    ],
+
+    primary_key_columns => [ 'id' ],
+
+    unique_keys => [
+        [ 'token' ],
+        [ 'email_address', 'sp_entityid' ],
+    ],
+);
+
+1;
+
diff --git a/lib/IdPAccountManager/Data/Authenticationtoken/Manager.pm b/lib/IdPAccountManager/Data/Authenticationtoken/Manager.pm
new file mode 100644
index 0000000000000000000000000000000000000000..9d71c8e31b8d4b0b7339bf7965bcc17702f2a60d
--- /dev/null
+++ b/lib/IdPAccountManager/Data/Authenticationtoken/Manager.pm
@@ -0,0 +1,14 @@
+package IdPAccountManager::Data::Authenticationtoken::Manager;
+
+use strict;
+
+use base qw(Rose::DB::Object::Manager);
+
+use IdPAccountManager::Data::Authenticationtoken;
+
+sub object_class { 'IdPAccountManager::Data::Authenticationtoken' }
+
+__PACKAGE__->make_manager_methods('authenticationtokens');
+
+1;
+
diff --git a/lib/IdPAccountManager/Data/Serviceprovider.pm b/lib/IdPAccountManager/Data/Serviceprovider.pm
new file mode 100644
index 0000000000000000000000000000000000000000..dc2046f5590240c350f78e6ad6911d50a99f34b6
--- /dev/null
+++ b/lib/IdPAccountManager/Data/Serviceprovider.pm
@@ -0,0 +1,23 @@
+package IdPAccountManager::Data::Serviceprovider;
+
+use strict;
+
+use base 'IdPAccountManager::DB::Object';
+
+__PACKAGE__->meta->setup(
+    table   => 'serviceproviders',
+
+    columns => [
+        id          => { type => 'bigserial', not_null => 1 },
+        entityid    => { type => 'varchar', length => 200, not_null => 1 },
+        displayname => { type => 'varchar', length => 500 },
+        contacts    => { type => 'varchar', length => 2000 },
+    ],
+
+    primary_key_columns => [ 'id' ],
+
+    unique_key => [ 'entityid' ],
+);
+
+1;
+
diff --git a/lib/IdPAccountManager/Data/Serviceprovider/Manager.pm b/lib/IdPAccountManager/Data/Serviceprovider/Manager.pm
new file mode 100644
index 0000000000000000000000000000000000000000..e23db299627bdf47f324ef9e2dea837c837716fb
--- /dev/null
+++ b/lib/IdPAccountManager/Data/Serviceprovider/Manager.pm
@@ -0,0 +1,14 @@
+package IdPAccountManager::Data::Serviceprovider::Manager;
+
+use strict;
+
+use base qw(Rose::DB::Object::Manager);
+
+use IdPAccountManager::Data::Serviceprovider;
+
+sub object_class { 'IdPAccountManager::Data::Serviceprovider' }
+
+__PACKAGE__->make_manager_methods('serviceproviders');
+
+1;
+
diff --git a/lib/IdPAccountManager/Data/Testaccount.pm b/lib/IdPAccountManager/Data/Testaccount.pm
index 3ecd53e74495fc636c82560ff7bdebceda6543df..ad57af7a875df9c87f5bee26e48c2e075b16a138 100644
--- a/lib/IdPAccountManager/Data/Testaccount.pm
+++ b/lib/IdPAccountManager/Data/Testaccount.pm
@@ -2,22 +2,21 @@ package IdPAccountManager::Data::Testaccount;
 
 use strict;
 
-use base qw(IdPAccountManager::Data::DB::Object::AutoBase2);
+use base 'IdPAccountManager::DB::Object';
 
 __PACKAGE__->meta->setup(
-    table => 'testaccounts',
+    table   => 'testaccounts',
 
     columns => [
-        id => { type => 'bigserial', not_null => 1 },
-        user_password_hash =>
-          { type => 'varchar', length => 50, not_null => 1 },
-        creation_date   => { type => 'integer' },
-        expiration_date => { type => 'integer' },
-        account_profile => { type => 'varchar', length => 100, not_null => 1 },
-        sp_entityid     => { type => 'varchar', length => 250, not_null => 1 },
+        id                 => { type => 'bigserial', not_null => 1 },
+        user_password_hash => { type => 'varchar', length => 50, not_null => 1 },
+        creation_date      => { type => 'integer' },
+        expiration_date    => { type => 'integer' },
+        account_profile    => { type => 'varchar', length => 100, not_null => 1 },
+        sp_entityid        => { type => 'varchar', length => 250, not_null => 1 },
     ],
 
-    primary_key_columns => ['id'],
+    primary_key_columns => [ 'id' ],
 );
 
 1;