drop table if exists cards;
drop table if exists binders;
drop table if exists leaves;
drop table if exists configure;
drop table if exists history;

create table cards(
    id int not null auto_increment,
    word text not null,
    pos text not null default '',
    japanese text not null default '',
    english text not null default '',
    example text not null default '',
    created timestamp not null default current time,
    primary key(id));

create table binders(
    id int not null auto_increment,
    name text not null default '新規バインダー',
    created timestamp not null default current time,
    primary key(id));

create table leaves(
    id int not null auto_increment,
    card_id int not null,
    binder_id int not null);