|
Parallel relationships can produce unspecified behaviour.
Especially if the other one finds out.
... such stuff as dreams are made on
|
|
|
|
|
Guess that guy couldn't relate
|
|
|
|
|
And therein lies the value of forced auditing, saved outside the environment.
Perhaps a block-chain on changes is needed... unless of course, the change is done from the 'sa' account and multiple people have access to the password.
|
|
|
|
|
I've experienced something like that once.
For no reason, quite a few FK's had disappeared...
I'm pretty certain no one on the team did it because we all knew the value of FK's.
To this day I've seen it once and still can't explain it.
My guess is that some external tool (comparer? EF? modeller?) removed them for some reason.
|
|
|
|
|
Sander Rossel wrote: I'm pretty certain no one on the team did it because we all knew the value of FK's.
Since "everyone knows it", no one would admit not knowing.
|
|
|
|
|
Last week I added a few fields to a table, no problem.
Yesterday we got the data and I realized I needed to change the type of one field in said table as the data was a bit different than I had expected.
No problem I think, we haven't added any data to that field yet, so I enter design mode, change the type and save the changes.
Up comes a popup stating it cannot rewrite the table as there are several tables depending on it.
No problems I think again, I cancel out of it and decide to change the table the next day using DDL instead.
And today to my surprise I see that the table does not have any foreign keys anymore.
Go figure. The takeaway is to not trust the designer mode of SSMS.
<edit>I haven't tested it fully yet, but it seems like it might happen when you have an indexed view on the table
modified 16-Feb-18 8:11am.
|
|
|
|
|
When I have that problem, I rename the column with a suffix of "_DELETE" and create a new column with the old name and newly desired characteristics. The designer will let me do that without dropping and recreating the table. After I have migrated any data and updated any involved stored procedures and entity framework models, I delete the old column.
|
|
|
|
|
I simply don't use the designer any more.
|
|
|
|
|
Sander Rossel (sort of) wrote: My guess is that some external tool removed them for some reason.
That's a pretty harsh way to refer to a contractor.
|
|
|
|
|
That's actually pretty kind compared to what I usually call them
I'm a contractor by the way
|
|
|
|
|
I've seen this too, and know the reason. It's not a good reason, but it's a reason.
I'd designed and built a database with full referential integrity.
A team of programmers started to build a system around it.
Every time their code violated the rules, guess what? An exception was triggered! As intended. Imagine that.
It came to time to roll out the project. This meant deploying a fresh copy of the database to a production server. I used the same scripts that I'd written to deploy the development copy.
This resulted in a herd of coders arriving at my desk, all red in the face, and demanding that I use the copy on the development machine. It seems that between them, their understanding of error handling consisted of "on error goto", and they'd been so overwhelmed by the exceptions that the RI in the database caused, they'd removed all of it from the database. Seems my idiot boss saw no harm in giving them admin rights on the database server. Thankfully, he took my side when I explained to him why the project was going to be delayed!
So, if you're surrounded by idiots, then there's a reason why the RI was removed. It's not a good reason, but it's certainly a reason. Namely, you're surrounded by idiots.
|
|
|
|
|
How could such software go into production?
It's not correct by definition
No (acceptance) testing?
|
|
|
|
|
Sander Rossel wrote: No (acceptance) testing?
There is no testing, like testing in production!
Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
|
|
|
|
|
Rob Grainger wrote: for some unknown reason It's always the same reason:
Some dimwit tries to insert or delete something and bounces off these foreign key constraints. Instead of adapting the application logic to take the constraints into account, the harebrain throws the constraints (and the database's integrity) out the window.
And what will they say when you ask them which part of 'referential integrity' they did not understand?
(Offended whine): "But it works (*)!"
(*) In there limited little world that means that the error message is gone, nothing more.
I have lived with several Zen masters - all of them were cats.
|
|
|
|
|
CodeWraith wrote: Some dimwit tries to insert or delete something and bounces off these foreign key constraints. Instead of adapting the application logic to take the constraints into account, the harebrain throws the constraints (and the database's integrity) out the window. First job out of college, I was that dimwit Jr Developer. We needed to delete a few items and add a few new ones. You guessed it, I ran into the constraints.
So I asked the Sr. Dev, he said to drop the keys, add and remove the items, then re-add the keys. Being a good student, I followed his advice. At least I was smart enough to use the automated generate Drop/Add script functionality in SQL so I didn't screw it up THAT much.
Learning through mistakes.
|
|
|
|
|
I can certainly forgive a junior, but also would make him repair the database and then scrub the courtyard with a toothbrush. Some old habits die hard.
The real horror are those who never learn and do this whenever they feel like it.
I have lived with several Zen masters - all of them were cats.
|
|
|
|
|
In this case I would say the Sr. Dev should repair it. Since the Jr Dev was following instructions.
Another thing would be if the Jr. Dev. just did it because he/she is smarter than the Sr. Dev.
CodeWraith wrote: Some old habits die hard. It is like smoking, the best... not to start
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Now that you remind me...
I forgot to insist on the first and the last words when anyone addresses me should be 'sir'. Another one of those old habits.
I have lived with several Zen masters - all of them were cats.
|
|
|
|
|
"SIR", Where you sergeant in the military? "SIR"?
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Exactly, but I only needed that Sir! stuff during an exchange program with the Americans.
I have lived with several Zen masters - all of them were cats.
|
|
|
|
|
I was always wondering if this was really as it is shown in some movies
As per you answer... I guess so
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
That kind of stuff was reserved for basic training or special occasions when you intended to hold a monologue to someone (which then usually ended with 'Dismissed', meaning 'get out of my sight').
I have lived with several Zen masters - all of them were cats.
|
|
|
|
|
Ah, the good, old high volume one-way discussion.
|
|
|
|
|
We like our formal modes of address, and have AR 600-20 to express how much we like it.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Sure, but it's hard to stay formal all the time in a team you spend more time with than your family.
Plus, that's that's a very fundamental matter, any regulations that smell like earth and are for the groundhogs would have applied to me. Not that our regulations would have been so different.
I have lived with several Zen masters - all of them were cats.
|
|
|
|