From c72f46b3b27e8c2454ea97d33e8433c721e040b5 Mon Sep 17 00:00:00 2001
From: Guillaume Rousse <guillaume.rousse@renater.fr>
Date: Fri, 14 Dec 2018 17:11:05 +0100
Subject: [PATCH] rename 'token' column in 'token' table to 'secret'

---
 conf/manager.sql            | 2 +-
 lib/AccountManager/Token.pm | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/conf/manager.sql b/conf/manager.sql
index 9c1c3ac..6e8fe9c 100644
--- a/conf/manager.sql
+++ b/conf/manager.sql
@@ -1,6 +1,6 @@
 CREATE TABLE tokens (
     id bigint(20) NOT NULL AUTO_INCREMENT,
-    token varchar(50) NOT NULL,
+    secret varchar(50) NOT NULL,
     email_address varchar(200) NOT NULL,
     entityid varchar(200) NOT NULL,
     creation_date datetime DEFAULT NULL,
diff --git a/lib/AccountManager/Token.pm b/lib/AccountManager/Token.pm
index 2daba49..1cf3421 100644
--- a/lib/AccountManager/Token.pm
+++ b/lib/AccountManager/Token.pm
@@ -12,7 +12,7 @@ __PACKAGE__->meta->setup(
 
     columns => [
         id              => { type => 'bigserial', not_null => 1 },
-        token           => { type => 'varchar', length => 50, not_null => 1, alias => 'secret' },
+        secret          => { type => 'varchar', length => 50, not_null => 1 },
         email_address   => { type => 'varchar', length => 200, not_null => 1 },
         entityid        => { type => 'varchar', length => 200, not_null => 1 },
         creation_date   => { type => 'datetime' },
@@ -22,7 +22,7 @@ __PACKAGE__->meta->setup(
     primary_key_columns => [ 'id' ],
 
     unique_keys => [
-        [ 'token' ],
+        [ 'secret' ],
         [ 'email_address', 'entityid' ],
     ],
 );
-- 
GitLab