Skip to content

Commit 27e0840

Browse files
committed
change database from h2 to postgres
1. fix bug in create-ratings! 2. improve query efficiency in get-movie-average 3. change migration files
1 parent 158929f commit 27e0840

File tree

8 files changed

+3393
-1740
lines changed

8 files changed

+3393
-1740
lines changed

Diff for: README.md

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# intowow
1+
# spark-movie-lens
22

33
generated using Luminus version "2.9.11.90"
44

@@ -8,17 +8,11 @@ generated using Luminus version "2.9.11.90"
88
lein migratus migrate
99
```
1010

11-
## Database Debug: invoke DB web console
12-
```
13-
wget http://repo2.maven.org/maven2/com/h2database/h2/1.4.196/h2-1.4.196.jar
14-
java -cp h2*.jar org.h2.tools.Server -webAllowOthers
15-
```
16-
1711
## Prerequisites
1812

19-
You will need [Leiningen][1] 2.0 or above installed.
20-
21-
Install libraries needed for spark.
13+
1. You will need [Leiningen][1] 2.0 or above installed.
14+
2. You will need to instll postgresql.
15+
3. Install libraries needed for spark.
2216

2317
```
2418
sudo apt-get install libgfortran3

Diff for: profiles.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
{:profiles/dev {:env {:database-url "jdbc:h2:./intowow_dev.db"}}
2-
:profiles/test {:env {:database-url "jdbc:h2:./intowow_test.db"}}}
1+
{:profiles/dev {:env {:database-url "jdbc:postgresql://localhost/intowow_dev?user=intowow&password=qwerty"}}
2+
:profiles/test {:env {:database-url "jdbc:postgresql://localhost/intowow_test?user=intowow&password=qwerty"}}}

Diff for: project.clj

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
:url "https://github.com/humorless/spark-movie-lens"
55

66
:dependencies [[gorillalabs/sparkling "1.2.2"]
7+
[org.apache.spark/spark-mllib_2.10 "1.1.0" :exclusions [com.google.guava/guava org.slf4j/slf4j-log4j12]]
8+
[org.apache.spark/spark-core_2.10 "1.1.0" :exclusions [com.google.guava/guava com.thoughtworks.paranamer/paranamer org.slf4j/slf4j-log4j12]]
79
[buddy "1.3.0"]
810
[cheshire "5.8.0"]
911
[jarohen/chime "0.2.2"]
1012
[clj-time "0.14.0"]
11-
[com.h2database/h2 "1.4.196"]
13+
[org.postgresql/postgresql "42.1.4"]
1214
[compojure "1.6.0"]
1315
[conman "0.6.9"]
1416
[cprop "0.1.11"]
@@ -50,9 +52,7 @@
5052
[lein-immutant "2.1.0"]]
5153

5254
:profiles
53-
{:provided {:dependencies [[org.apache.spark/spark-mllib_2.10 "1.1.0" :exclusions [com.google.guava/guava org.slf4j/slf4j-log4j12]]
54-
[org.apache.spark/spark-core_2.10 "1.1.0" :exclusions [com.google.guava/guava com.thoughtworks.paranamer/paranamer org.slf4j/slf4j-log4j12]]]}
55-
:uberjar {:omit-source true
55+
{:uberjar {:omit-source true
5656
:aot :all
5757
:uberjar-name "intowow.jar"
5858
:source-paths ["env/prod/clj"]
+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
CREATE TABLE users
2-
(id INT PRIMARY KEY auto_increment,
2+
(id SERIAL PRIMARY KEY,
33
email VARCHAR(40),
44
pass VARCHAR(300),
55
sess UUID);
66
--;;
7-
INSERT INTO PUBLIC.USERS(ID, EMAIL, PASS, SESS) VALUES
8-
(1000, '[email protected]', 'bcrypt+sha512$2e2c9e9e74c2242f02721247b78544ee$12$956dfdf3dad4eade193141b2c4e090d06a4c18a53736490c', '44e6b1b8-95ff-47c9-a9fd-4c4dabcfa1ce');
7+
ALTER SEQUENCE users_id_seq RESTART WITH 1000;

0 commit comments

Comments
 (0)