Skip to content

Commit c383f9d

Browse files
authored
Merge pull request #12 from geshan/reset-data
Sample reset-data file
2 parents 46e42a6 + 4c78ffd commit c383f9d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

reset-data.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const db = require('./services/db');
2+
3+
(async () => {
4+
await db.query(`TRUNCATE quote RESTART IDENTITY`);
5+
await db.query(`INSERT INTO quote (id, quote, author) VALUES
6+
(1, 'There are only two kinds of languages: the ones people complain about and the ones nobody uses.', 'Bjarne Stroustrup'),
7+
(2, 'Any fool can write code that a computer can understand. Good programmers write code that humans can understand.', 'Martin Fowler'),
8+
(3, 'First, solve the problem. Then, write the code.', 'John Johnson'),
9+
(4, 'Java is to JavaScript what car is to Carpet.', 'Chris Heilmann'),
10+
(5, 'Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.', 'John Woods'),
11+
(6, 'I''m not a great programmer; I''m just a good programmer with great habits.', 'Kent Beck'),
12+
(7, 'Truth can only be found in one place: the code.', 'Robert C. Martin'),
13+
(8, 'If you have to spend effort looking at a fragment of code and figuring out what it''s doing, then you should extract it into a function and name the function after the "what".', 'Martin Fowler'),
14+
(9, 'The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming.', 'Donald Knuth'),
15+
(10, 'SQL, Lisp, and Haskell are the only programming languages that I’ve seen where one spends more time thinking than typing.', 'Philip Greenspun'),
16+
(11, 'Deleted code is debugged code.', 'Jeff Sickel'),
17+
(12, 'There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.', 'C.A.R. Hoare'),
18+
(13, 'Simplicity is prerequisite for reliability.', 'Edsger W. Dijkstra'),
19+
(14, 'There are only two hard things in Computer Science: cache invalidation and naming things.', 'Phil Karlton'),
20+
(15, 'Measuring programming progress by lines of code is like measuring aircraft building progress by weight.', 'Bill Gates'),
21+
(16, 'Controlling complexity is the essence of computer programming.', 'Brian Kernighan'),
22+
(17, 'The only way to learn a new programming language is by writing programs in it.', 'Dennis Ritchie')`);
23+
console.log(`Quotes have been reset to 17 original quotes`);
24+
})();

0 commit comments

Comments
 (0)