@@ -24,7 +24,8 @@ CREATE TABLE posts (
2424 date TEXT NOT NULL,
2525 content TEXT NOT NULL DEFAULT '',
2626 commits TEXT,
27- tags TEXT
27+ tags TEXT,
28+ description TEXT
2829);
2930CREATE TABLE commits (
3031 id TEXT PRIMARY KEY,
@@ -76,6 +77,7 @@ pub fn seed(conn: &Connection) {
7677 & str ,
7778 Option < & str > ,
7879 Option < & str > ,
80+ Option < & str > ,
7981 ) ] = & [
8082 (
8183 "post-01" ,
@@ -88,6 +90,7 @@ pub fn seed(conn: &Connection) {
8890 "link post content" ,
8991 Some ( r#"["commit-1"]"# ) ,
9092 Some ( r#"["rust","web"]"# ) ,
93+ Some ( "A post about Rust and the web." ) ,
9194 ) ,
9295 (
9396 "post-02" ,
@@ -100,6 +103,7 @@ pub fn seed(conn: &Connection) {
100103 "quoted text here" ,
101104 Some ( r#"["commit-2","commit-1"]"# ) ,
102105 Some ( r#"["rust"]"# ) ,
106+ None ,
103107 ) ,
104108 (
105109 "post-03" ,
@@ -112,6 +116,7 @@ pub fn seed(conn: &Connection) {
112116 "golang article about performance" ,
113117 None ,
114118 Some ( r#"["go"]"# ) ,
119+ Some ( "An article about Go and performance." ) ,
115120 ) ,
116121 (
117122 "post-04" ,
@@ -124,6 +129,7 @@ pub fn seed(conn: &Connection) {
124129 "regular post" ,
125130 None ,
126131 None ,
132+ None ,
127133 ) ,
128134 (
129135 "post-05" ,
@@ -136,6 +142,7 @@ pub fn seed(conn: &Connection) {
136142 "regular post" ,
137143 None ,
138144 None ,
145+ None ,
139146 ) ,
140147 (
141148 "post-06" ,
@@ -148,6 +155,7 @@ pub fn seed(conn: &Connection) {
148155 "regular post" ,
149156 None ,
150157 None ,
158+ None ,
151159 ) ,
152160 (
153161 "post-07" ,
@@ -160,6 +168,7 @@ pub fn seed(conn: &Connection) {
160168 "regular post" ,
161169 None ,
162170 None ,
171+ None ,
163172 ) ,
164173 (
165174 "post-08" ,
@@ -172,6 +181,7 @@ pub fn seed(conn: &Connection) {
172181 "regular post" ,
173182 None ,
174183 None ,
184+ None ,
175185 ) ,
176186 (
177187 "post-09" ,
@@ -184,6 +194,7 @@ pub fn seed(conn: &Connection) {
184194 "regular post" ,
185195 None ,
186196 None ,
197+ None ,
187198 ) ,
188199 (
189200 "post-10" ,
@@ -196,6 +207,7 @@ pub fn seed(conn: &Connection) {
196207 "regular post" ,
197208 None ,
198209 None ,
210+ None ,
199211 ) ,
200212 (
201213 "post-11" ,
@@ -208,6 +220,7 @@ pub fn seed(conn: &Connection) {
208220 "regular post" ,
209221 None ,
210222 None ,
223+ None ,
211224 ) ,
212225 (
213226 "post-12" ,
@@ -220,6 +233,7 @@ pub fn seed(conn: &Connection) {
220233 "regular post" ,
221234 None ,
222235 None ,
236+ None ,
223237 ) ,
224238 (
225239 "about" ,
@@ -232,14 +246,15 @@ pub fn seed(conn: &Connection) {
232246 "about page content" ,
233247 None ,
234248 None ,
249+ None ,
235250 ) ,
236251 ] ;
237252
238- for ( id, ct, title, link, via, qa, date, content, commits, tags) in posts {
253+ for ( id, ct, title, link, via, qa, date, content, commits, tags, description ) in posts {
239254 conn. execute (
240- "INSERT INTO posts(id,content_type,title,link,via,quote_author,date,content,commits,tags)
241- VALUES (?1,?2,?3,?4,?5,?6,?7,?8,?9,?10)" ,
242- rusqlite:: params![ id, ct, title, link, via, qa, date, content, commits, tags] ,
255+ "INSERT INTO posts(id,content_type,title,link,via,quote_author,date,content,commits,tags,description )
256+ VALUES (?1,?2,?3,?4,?5,?6,?7,?8,?9,?10,?11 )" ,
257+ rusqlite:: params![ id, ct, title, link, via, qa, date, content, commits, tags, description ] ,
243258 )
244259 . unwrap ( ) ;
245260
0 commit comments