다음과 같이 테이블이 생성된 것도 볼 수 있다.
$ cd $PRJNAME/web
$ sqlite3 db.sqlite3
SQLite version 3.15.0 2016-10-14 10:20:30
Enter ".help" FOR usage hints.
sqlite> .schema
CREATE TABLE "django_migrations" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "app" VARCHAR(255) NOT NULL, "name" VARCHAR(255) NOT NULL, "applied" datetime NOT NULL);
CREATE TABLE "TB_ADMIN" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "userid" VARCHAR(255) NOT NULL UNIQUE, "password" VARCHAR(255) NOT NULL, "nick" VARCHAR(255) NOT NULL UNIQUE, "mobile" VARCHAR(255) NOT NULL, "reg_date" DATE NOT NULL, "last_login" datetime NULL);
CREATE TABLE "django_session" ("session_key" VARCHAR(40) NOT NULL PRIMARY KEY, "session_data" text NOT NULL, "expire_date" datetime NOT NULL);
CREATE INDEX "django_session_de54fa62" ON "django_session" ("expire_date");sqlite> INSERT INTO admins(userid, password, nick) VALUES('testid1', 'passwd1', 'nick1');
sqlite> INSERT INTO TB_ADMIN(userid, password, nick, mobile, reg_date) VALUES('testid1', 'passwd1', 'nick1', '010-1111-1111', '2016-11-16');
sqlite> INSERT INTO TB_ADMIN(userid, password, nick, mobile, reg_date) VALUES('testid2', 'passwd2', 'nick2', '010-2222-2222', '2016-11-16');
sqlite> INSERT INTO TB_ADMIN(userid, password, nick, mobile, reg_date) VALUES('testid3', 'passwd3', 'nick3', '010-3333-3333', '2016-11-16');
sqlite> INSERT INTO TB_ADMIN(userid, password, nick, mobile, reg_date) VALUES('testid4', 'passwd4', 'nick4', '010-4444-4444', '2016-11-16');
sqlite> INSERT INTO TB_ADMIN(userid, password, nick, mobile, reg_date) VALUES('testid5', 'passwd5', 'nick5', '010-5555-5555', '2016-11-16');
sqlite> SELECT * FROM tb_admin;
1|testid1|passwd1|nick1|010-1111-1111|2016-11-16|
2|testid2|passwd2|nick2|010-2222-2222|2016-11-16|
3|testid3|passwd3|nick3|010-3333-3333|2016-11-16|
4|testid4|passwd4|nick4|010-4444-4444|2016-11-16|
5|testid5|passwd5|nick5|010-5555-5555|2016-11-16|
sqlite> .quit
댓글
댓글 쓰기