Skip to content

Commit

Permalink
Add an API key to the machines
Browse files Browse the repository at this point in the history
  • Loading branch information
atrodo committed May 24, 2011
1 parent 1a50d53 commit b5e6420
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions itfy_create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

CREATE TABLE IF NOT EXISTS `machine` (
`machine_id` varchar(36) NOT NULL,
`api_key` varchar(36) NOT NULL UNIQUE,
`name` varchar(32) NOT NULL UNIQUE,
`phys_mem` varchar(255) NOT NULL,
`os` varchar(255) NOT NULL,
Expand Down
3 changes: 3 additions & 0 deletions lib/itfy/Schema/ItfyDB/Result/Machine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ __PACKAGE__->table("machine");
__PACKAGE__->add_columns(
"machine_id",
{ data_type => "varchar", is_nullable => 0, size => 36 },
"api_key",
{ data_type => "varchar", is_nullable => 0, size => 36 },
"name",
{ data_type => "varchar", is_nullable => 0, size => 32 },
"phys_mem",
Expand All @@ -32,6 +34,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("machine_id");
__PACKAGE__->uuid_columns("machine_id");
__PACKAGE__->add_unique_constraint([ qw/name/ ]);
__PACKAGE__->add_unique_constraint([ qw/api_key/ ]);

__PACKAGE__->has_many('bench_runs' => 'itfy::Schema::ItfyDB::Result::BenchRun', "machine_id");

Expand Down

0 comments on commit b5e6420

Please sign in to comment.