1

I have a mySQL database that receives data from users online once logged in. The data table was created like so...

CREATE TABLE   
IF NOT EXISTS `results` (
       `id` INT(11) NOT NULL AUTO_INCREMENT,
       `patient_id` CHAR(10) NOT NULL,
       `login_id` CHAR(7) NOT NULL,
       `result_date` date NOT NULL,
       `result` VARCHAR(4) NOT NULL,
       created_at TIMESTAMP NOT NULL,
       PRIMARY KEY(`id`)
   ) DEFAULT CHARSET = utf8 COMMENT = 'List of Member Test Results'
    ;

Once completed, our IT manager decided to alter my database and PHP code, so he can pull data into his SQL Server database easily. My questions will be two fold, is this necessary and are there potential issues with doing it this way.

The things he changed; altered result_date from a date to other data type, so he can input on my end in SQL Server format. He altered timestamp/created at so his alteration does not update the timestamp, and he added a boolean/counter column, so his database knows if it has extracted from that row. Also, he added a third date (date like field as non-date type) so when he pulls from my database, he can mark that time.

To me this not only seems like overkill, it also forces me to allow alteration of my database. Lastly, I was scolded for "why would you use created_at timestamp NOT NULL". Not wanting to call someone out on this, but this issue has me a bit perplexed.

4

2 に答える 2

2

As the others have pointed out in comments, it does appear your IT Manager is not as sharp. To simplify things on his end, why didn't he just add a column to his SQL table of ImportIDFromMySQL and use your auto-increment. There, he has it or he doesn't. As for caring about the date/time stamps, he should just add the extra columns to his "pretty" table and leave your production stuff alone.

Sometimes bean-counter managers can really be a handful to deal with.

于 2013-01-23T04:49:36.200 に答える
1

Altering the database and making changes are fine. However, my recommendation would be to create mirror databases and he can then do what he wants on the mirror database. Changing the structure of the database may cause many problems in many levels. Always backup your database before you alter, delete, truncate or use any functions related to delete and update statments.

Your IT manager should have created a mirror database. Well, going forward he still can.

于 2013-01-23T04:46:33.800 に答える