What is the best pratice?.

 
Nugent: So that is one kind of “thing” you’re modelling: a “question”

Nugent: Another kind of thing is a “car”

Clyatt: SirLagz: Such a common story :

Nugent: So you’ve a car identified by licence # “123 abc”

Nugent: And a question “all wheel nuts fitted”

Auzston: Nugent: something like that yeah

Nugent: And at some point you’re asking “are all wheel nuts fitted for car #123abc?”

Nugent: That has a yes/no answer, and a comment

Nugent: The yes/no answer is one datum, and the comment another.

Almario: Nugent: yep, got that

Clyatt: SirLagz: A friend asks you to write something very simple and tells you it is never going to change and it will be rarely used. Some time later he shows it to someone else who thinks it might be great to use it in production for much more complex project and hires bunch of developers to modify it. Soon they start cursing you 24×7 for the bad design they have to stick to :

Nugent: Both pieces of data depend on the composite {car/question} identity

Detrick: Salle: haha, if that happened, it’d be awesome 😛

Nugent: So when you design a database, you end up asking “What does this datum depend on?”, and the full set of answers you derive becomes the basis for your set of tables.

Wrona: Nugent: I did read up on this a while ago when I was doing database stuff more, but I’m a bit rusty on this stuff now heh

Latassa: Nugent: thanks for the refresher though!

Clyatt: SirLagz: Once I got phone call from someone asking me if I can adapt a “web application” for their needs because they saw my name on the website. It was quickly written reporting tool for some internal task I did about 10 years ago and forgot how and what was there and it was written in php 4.0 against MySQL 4.0

Wogan: Salle: haha, how the past comes to haunt you hey

Clyatt: SirLagz: and I got the phone call years after stopping using PHP

Halpert: I’ll probably regret this later.but that’s future me’s problem

Wojtaszek: Salle, Nugent thanks for all the help and pointers

Maisonave: Is there a way to insert multiple rows with one query?

Norgard: I did, that’s why I’m here.

Decoux: Side_FX: yes, extended inserts.

Kummerow: All of the hits for “Is there a way to insert multiple rows with one query? mysql” appear to be relevant. :

Jansma: How do we save the +—————+- table output in bash to a text file

Saltonstall: The standard query file.txt

Merzig: Does not save +—————+-

Friedel: I tried tee it still does not save +——-+

Decoux: Famy-: mysql -e “query here” file ?

Menousek: Decoux: tried that first

Bachinski: Famy-: the mysql -B option removes those marks

Scioneaux: I want to “save” those marks

Bachinski: Famy-: by default they stay

Klines: Nope they only stay when using the -vvv option

Lagrimas: Yea but then it shows the query and a bunch of other stuff that I don’t want ot have to sed out etc

Bachinski: Famy-: my apologies, I just tested and you are correct

Woskobojnik: See http://dev.mysql.com/doc/refman/5.6/en/mysql.html

Vandenbos: Bachinski: its ok. Just looking for a easy solution without creating a too complex bash script

Dewitz: Having the +—————+- in the text file helps a lot so the text stays the same

Decoux: It’s amazing what you find when you read the manual

Bachinski: Famy-: heh, –raw outputs it to the screen but doesn’t when redirecting to file

Bachinski: Decoux: there you go, good one :-

Decoux: No one reads the manual any more.

Bachinski: Just tested it positive outcome

Leeks: What is the best pratice? One authenticable model called “Account”, and this model has_one “User” and has_one “Employee” **OR** two authenticable models “User” and “Employee”, that they implement the “Authenticable” concern?