Programmer's Cookbook

Recipes for the practical programmer

Friday, June 13, 2008

 

DB Schema for Spring-Security 2.0

Spring Security was only recently released, so the docs are fairly poor. So if you have been looking everywhere for the DB schema to use with <jdbc-user-service/>, look no further.

Here are the generic table create statements. The foreign-key columns are marked, which you can either ignore or translate them for your specific DB.


create table users (
username varchar(32) primary key,
password varchar(64) not null,
enabled bit not null
)

create table authorities (
username varchar(32) not null, [FK]
authority varchar(64) not null
)

create table groups (
id number(10) primary key,
group_name varchar(64)
)

create table group_members (
group_id number(10) not null, [FK]
username varchar(32) not null [FK]
)

create table group_authorities (
group_id number(10) not null, [FK]
authority varchar(64) not null
)

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?