-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·28 lines (24 loc) · 821 Bytes
/
init.sh
File metadata and controls
executable file
·28 lines (24 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# create database w/ extensions
echo "DROP DATABASE IF EXISTS gdelt" | psql
echo "CREATE DATABASE gdelt" | psql
echo "CREATE EXTENSION IF NOT EXISTS PostGIS" | psql -d gdelt
# create CAMEO tables
echo "create countryCode table"
psql -d gdelt -f db/countryCodeTable.sql
echo "create ethnicCode table"
psql -d gdelt -f db/ethnicCodeTable.sql
echo "create knownGroupCode table"
psql -d gdelt -f db/knownGroupCodeTable.sql
echo "create religionCode table"
psql -d gdelt -f db/religionCodeTable.sql
echo "create eventCode table"
psql -d gdelt -f db/eventCodeTable.sql
echo "create typeCode table"
psql -d gdelt -f db/typeCodeTable.sql
# create events table
echo "create events table"
psql -d gdelt -f db/eventsTable.sql
# create views
echo "create events full text view"
psql -d gdelt -f db/eventsFullView.sql