]> gitweb.michael.orlitzky.com - dead/census-tools.git/blobdiff - makefile
Added a unique index on the tiger_lines "tlid" column.
[dead/census-tools.git] / makefile
index b7ef3c24eea0b7dae47d776351dd2e0fd3527e25..bfccc236762944d8830f6b51eb797b3de351b124 100644 (file)
--- a/makefile
+++ b/makefile
@@ -129,13 +129,15 @@ db: data newdb tiger_blocks_table tiger_lines_table sf1_blocks_table
 # and leave -I out.
        for state in data/census2000/*; do                          \
                for shapefile in $$state/lines/*.shp; do            \
+                       echo "Importing $$shapefile.";              \
                        $(PG_BINDIR)/shp2pgsql                      \
                                -a                                  \
                                -s $(TIGER_SRID)                    \
-                               -D                                  \
                                $$shapefile                         \
                                tiger_lines                         \
-                               | psql -U $(DB_USER) -d $(DB_NAME); \
+                               | bin/filter-transactions           \
+                               | psql -U $(DB_USER) -d $(DB_NAME)  \
+                               > /dev/null;                        \
                done;                                               \
        done;
 
@@ -203,3 +205,8 @@ tiger_lines_table:
                tiger_lines                                            \
                | psql -U postgres -d $(DB_NAME)                       \
                 > /dev/null
+
+# Add a unique index on the "tlid" column.
+       psql -U postgres \
+             -d census   \
+             -f sql/create_tlid_unique_index.sql