Open aethelwulffe opened 6 years ago
ADDING: SQL file validator [dev tool] for ensuring file does not contain comments, or is otherwise broken.
May be a directory structure holding the files for the version in addition to File name by table (possibly with version appended, like addresses.1.sql) /Ver_1.0.1
Look at the lavavel style migration/setup stull that has already been done and model on that. Each "database table" and it's needs are a separate date/time stamped executable PHP. You may even be able to most of it already.
Tony McCormick, CTO www.mi-squared.com Support: 866-735-0897, Direct: 713-574-6709 My Calendar: http://bit.ly/XznvDo -Verba volant, scripta manent
On Fri, Oct 13, 2017 at 11:48 AM, Terry Hill notifications@github.com wrote:
May be a directory structure holding the files for the version in addition to File name by table (possibly with version appended, like addresses.1.sql) /Ver_1.0.1
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/LibreHealthIO/LibreEHR/issues/719#issuecomment-336537101, or mute the thread https://github.com/notifications/unsubscribe-auth/AARci4jWbOk4XHIY0Pzo1cjEDx8zd9muks5sr7CUgaJpZM4P42Iq .
-- Please be aware that e-mail communication can be intercepted in transmission or misdirected. Please consider communicating any sensitive information by telephone. The information contained in this message may be privileged and confidential. If you are NOT the intended recipient, please notify the sender immediately with a copy to hipaa-security@mrsb-ltd.com and destroy this message.
Go @aethelwulffe go
Branch for this: https://github.com/LibreHealthIO/LibreEHR/tree/database_breakup
Separated each table structure like so: /sql/structure/_table_addresses.sql Might rename this to sql/create/ as that is the function used there. These files merely create the fields like so:
CREATE TABLE `addresses` (
`id` int(11) NOT NULL DEFAULT '0',
`line1` varchar(255) DEFAULT NULL,
`line2` varchar(255) DEFAULT NULL,
`city` varchar(255) DEFAULT NULL,
`state` varchar(35) DEFAULT NULL,
`zip` varchar(10) DEFAULT NULL,
`plus_four` varchar(4) DEFAULT NULL,
`country` varchar(255) DEFAULT NULL,
`foreign_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Next, I have separated the key declarations and the like with a separate set of files in sql/alter/_alter_addreses.sql These are done as ALTER statements. This provides an error checking breakpoint like so:
ALTER TABLE `addresses`
ADD PRIMARY KEY (`id`),
ADD KEY `foreign_id` (`foreign_id`);
There may be more than one ALTER statement in each file, such as for declaring unsigned integers and the like. This makes each step trackable for point breaks.
ALTER TABLE `onsite_documents`
ADD PRIMARY KEY (`id`);
ALTER TABLE `onsite_documents`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
The third flavor (not done yet) will be where the DEFAULT INSERTS go. All inserts in database.sql will be move to the default insert file list. Many of these will be optional. Most of the ones for things like 'facilities' will be configurable at setup.
Currently, the tables include a default engine and characterset. The intention is that the characterset can be defined during install as well (as it is). I assume I will need to redact those lines.
Looks good
Tony McCormick
On Oct 13, 2017 5:07 PM, "Art Eaton" notifications@github.com wrote:
Branch for this: https://github.com/LibreHealthIO/LibreEHR/tree/database_breakup
Separated each table structure like so: /sql/structure/table addresses.sql Might rename this to sql/create/ as that is the function used there. These files merely create the fields like so:
CREATE TABLE
addresses
(id
int(11) NOT NULL DEFAULT '0',line1
varchar(255) DEFAULT NULL,line2
varchar(255) DEFAULT NULL,city
varchar(255) DEFAULT NULL,state
varchar(35) DEFAULT NULL,zip
varchar(10) DEFAULT NULL,plus_four
varchar(4) DEFAULT NULL,country
varchar(255) DEFAULT NULL,foreign_id
int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;Next, I have separated the key declarations and the like with a separate set of files in sql/alter/_alter_addreses.sql These are done as ALTER statements. This provides an error checking breakpoint like so:
ALTER TABLE
addresses
ADD PRIMARY KEY (id
), ADD KEYforeign_id
(foreign_id
);There may be more than one ALTER statement in each file, such as for declaring unsigned integers and the like. This makes each step trackable for point breaks.
ALTER TABLE
onsite_documents
ADD PRIMARY KEY (id
); ALTER TABLEonsite_documents
MODIFYid
int(10) UNSIGNED NOT NULL AUTO_INCREMENT;The third flavor (not done yet) will be where the DEFAULT INSERTS go. All inserts in database.sql will be move to the default insert file list. Many of these will be optional. Most of the ones for things like 'facilities' will be configurable at setup.
Currently, the tables include a default engine and characterset. The intention is that the characterset can be defined during install as well (as it is). I assume I will need to redact those lines.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LibreHealthIO/LibreEHR/issues/719#issuecomment-336594049, or mute the thread https://github.com/notifications/unsubscribe-auth/AARci2pF8ekBIwmtCgFn-8apoD1Hj0gEks5sr_tEgaJpZM4P42Iq .
-- Please be aware that e-mail communication can be intercepted in transmission or misdirected. Please consider communicating any sensitive information by telephone. The information contained in this message may be privileged and confidential. If you are NOT the intended recipient, please notify the sender immediately with a copy to hipaa-security@mrsb-ltd.com and destroy this message.
Starting a project for at least a temporary new setup and upgrade/patch system. This may be replaced with some Laravel thing in the future. PLAN
Iteration 2:
Iteration 3: