Skip to content

Commit

Permalink
#9 updating required SQL scripts for authentication database creation…
Browse files Browse the repository at this point in the history
…. Preparing for v1.2 release.
  • Loading branch information
tigreped committed Dec 4, 2015
1 parent 262482a commit 01352f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>br.gov.sibbr</groupId>
<artifactId>api</artifactId>
<version>1.2-SNAPSHOT</version>
<version>1.2</version>
<name>API</name>
<description>A simple java api to provide access to liger-data-access tables</description>

Expand Down
8 changes: 6 additions & 2 deletions src/main/resources/database/schema.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Structure required to accomodate authentication information
create table api_token(auto_id serial PRIMARY KEY, token varchar(64) not null, created_at timestamp not null);
create table api_user(auto_id serial PRIMARY KEY, email text, password varchar (64), salt varchar (32), token_id integer references api_token (auto_id));
create table api_token(auto_id serial PRIMARY KEY, token varchar(64) unique not null, created_at timestamp not null);
create table api_user(auto_id serial PRIMARY KEY, email text unique, password varchar (64), salt varchar (32) unique, authorized boolean default false, token_id integer references api_token (auto_id));
insert into api_user (email, password, salt, authorized) values ('[email protected]', 'a45ef5caf288ee1430a081b0d98f7f66a8b48a69b930c6c7740965875a3f4e1d', '21232f297a57a5a743894a0e4a801fc3', true);
create index api_user_email_index on api_user (email);
create index api_token_token_index on api_token (token);

0 comments on commit 01352f8

Please sign in to comment.