mikeizbicki / cmc-csci143

big data course materials
40 stars 76 forks source link

Add schema-indexes.sql to Dockerfile? #523

Open henrylong612 opened 7 months ago

henrylong612 commented 7 months ago

Hello @mikeizbicki!

In the project, it says to do the following:

IMPORTANT: As you create your indexes, you should add them to the file services/pg_normalized_batch/schema-indexes.sql. (Like the schema.sql file, this file would get automatically run by postgres if you were to rebuild the containers+images.)

Do I need to add the second line below to the Dockerfile?

COPY schema.sql /docker-entrypoint-initdb.d/01.sql
COPY schema-indexes.sql /docker-entrypoint-initdb.d/01.sql
mikeizbicki commented 7 months ago

You don't need to modify the Dockerfile for the assignment. In an industrial setting, however, you're right that the Dockerfile should be modified to add the indexes automatically when the database is brought up from scratch.