(使用MySql)
create table urls
(
url_id bigint auto_increment, --資料ID
url_shorten varchar default 10 null, --縮短後的url
url_dest longtext null --重新導向後的url
);
create unique index urls_url_id_uindex
on urls (url_id);
create unique index urls_url_shorten_uindex
on urls (url_shorten);
alter table urls
add constraint urls_pk
primary key (url_id);