Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sql/ght-restore-pg
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ fi
echo "`date` Creating the DB schema"
cat $dumpDir/pg_schema.sql | $psql

# 1.5 some commits data comtain invalid datetime values, this step will replace those values with earlist unix time
sed -i -e 's/0000-00-00 00:00:00/1970-01-02 00:00:00/' commits.csv

# 2. Restore CSV files with disabled FK checks
for f in $dumpDir/*.csv ; do
table=`basename $f|cut -f1 -d'.'`
Expand Down
1 change: 1 addition & 0 deletions sql/pg_indexes_and_foreign_keys.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ALTER TABLE ONLY users ADD CONSTRAINT users_login_key UNIQUE (login);

CREATE INDEX "followers_follower_id" ON "followers" ("follower_id");
CREATE INDEX "project_commits_commit_id" ON "project_commits" ("commit_id");
CREATE INDEX "project_commits_project_id" ON "project_commits" ("project_id");
CREATE INDEX "project_languages_project_id" ON "project_languages" ("project_id");
CREATE INDEX "projects_name" ON "projects" ("name");

Expand Down
2 changes: 1 addition & 1 deletion sql/pg_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ CREATE TABLE "users" (
"country_code" character(3),
"state" character varying(255),
"city" character varying(255),
"location" character text
"location" text
)
WITHOUT OIDS;

Expand Down