다음과 같이 테이블이 생성된 것도 볼 수 있다.
xyz\database> sqlite3 development.sqlite
SQLite version 3.15.0 2016-10-14 10:20:30
Enter ".help" for usage hints.
sqlite> .schema
CREATE TABLE "adonis_schema" ("id" integer not null primary key autoincrement, "name" varchar(255), "batch" integer, "migration_time" datetime default CURRENT_TIMESTAMP);
CREATE TABLE "users" ("id" integer not null primary key autoincrement, "username" varchar(80) not null, "email" varchar(254) not null, "password" varchar(60) not null, "created_at" datetime, "updated_at" datetime);
CREATE UNIQUE INDEX "users_username_unique" on "users" ("username");
CREATE UNIQUE INDEX "users_email_unique" on "users" ("email");
CREATE TABLE "tokens" ("id" integer not null primary key autoincrement, "user_id" integer, "token" varchar(40) not null, "is_revoked" boolean default '0', "created_at" datetime, "updated_at" datetime, foreign key("user_id") references "users"("id"));
CREATE UNIQUE INDEX "tokens_token_unique" on "tokens" ("token");
CREATE TABLE "admins" ("id" integer not null primary key autoincrement, "userid" varchar(255), "password" varchar(255) not null, "nick" varchar(255));
CREATE UNIQUE INDEX "admins_userid_unique" on "admins" ("userid");
CREATE UNIQUE INDEX "admins_nick_unique" on "admins" ("nick");
sqlite> insert into admins(userid, password, nick) values('testid1', 'passwd1', 'nick1');
sqlite> insert into admins(userid, password, nick) values('testid2', 'passwd2', 'nick2');
sqlite> insert into admins(userid, password, nick) values('testid3', 'passwd3', 'nick3');
sqlite> insert into admins(userid, password, nick) values('testid4', 'passwd4', 'nick4');
sqlite> insert into admins(userid, password, nick) values('testid5', 'passwd5', 'nick5');
sqlite> select * from admins;
1|testid1|passwd1|nick1
2|testid2|passwd2|nick2
3|testid3|passwd3|nick3
4|testid4|passwd4|nick4
5|testid5|passwd5|nick5
sqlite> .quit
댓글
댓글 쓰기