-- Initialize Query for SQLite
-- WindyHanas Solanara:SQLite - http://www.solanara.net/solanara/sqlite
select 'SQLite ' || sqlite_version();
create table if not exists userinfo (
        seq integer
                constraint userinfo_seq_pk primary key
                constraint userinfo_seq_fk references authinfo (seq),
        username varchar(255)
                constraint userinfo_username_nn not null,
        tel1     varchar(255),
        tel2     varchar(255),
        grade    real default 1.0,
        desc     text,
        photo    blob,
        rdate    datetime default current_timestamp
                constraint userinfo_rdate_nn not null
);
drop view if exists userlist;
drop view if exists userjoinstat;
begin transaction;
insert into userinfo (seq, username, tel1) values (1, '윈디하나', '010-000-0000');
insert into userinfo (seq, username, tel1) values (2, '루트', '010-111-1111');
commit;
analyze userinfo;