zipperer / migrate_database_with_michael

0 stars 0 forks source link

For table `mailing_list` make new column to identify listener, use integer that increments automatically #6

Closed zipperer closed 5 months ago

zipperer commented 7 months ago

From comment

During this meeting, we noticed that the listenerid column in the mailing_list table is a custom identifier. The custom identifier uses first initial, last initial, abbreviation for state / geography, and possibly other information. We will add another column to use as an identifier. For now all the new column listenerid_new. For column listenerid we will use a unique integer that increments automatically -- i.e. for postgres a SERIAL.

zipperer commented 7 months ago

I record here one approach to do this:

After these steps:

Alternative choices within this approach: either

zipperer commented 7 months ago

Alternative choices within this approach: either

  • keep column listenerid, make a new column, both columns stay, and relate new columns in different tables, or
  • keep only one column that identifies listener, and delete column with old scheme for identifying listener (i.e. delete column with values like ASTN1)

We will probably keep both columns.

zipperer commented 7 months ago

During #3 , we created the new column. We have not yet made it

PRIMARY KEY

We have not yet imported data into other tables that use listenerid, so we have not yet:

zipperer commented 5 months ago

We have not yet imported data into other tables that use listenerid, so we have not yet:

  • added a column to those tables
  • populated that column in those tables
  • made that new column a FOREIGN KEY / REFERENCES the listenerid_new in mailing_list

We have now done this with table offerings.