Guest User


a guest
Dec 15th, 2018
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <posts>
  2.   <row Id="1" PostTypeId="1" CreationDate="2011-01-03T20:46:02.927" Score="180" ViewCount="172059" Body="&lt;p&gt;What are the main differences between InnoDB and MyISAM?&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2017-03-09T13:33:47.627" Title="What are the main differences between InnoDB and MyISAM?" Tags="&lt;mysql&gt;&lt;innodb&gt;&lt;myisam&gt;" AnswerCount="10" CommentCount="1" FavoriteCount="105" />
  3.   <row Id="2" PostTypeId="1" AcceptedAnswerId="4" CreationDate="2011-01-03T20:46:32.393" Score="63" ViewCount="8595" Body="&lt;p&gt;What version control methodologies help teams of people track database schema changes?&lt;/p&gt;&#xA;" OwnerUserId="7" LastEditorUserId="97" LastEditDate="2011-01-06T11:25:12.520" LastActivityDate="2017-08-16T09:08:33.070" Title="How can a group track database schema changes?" Tags="&lt;mysql&gt;&lt;version-control&gt;&lt;schema&gt;" AnswerCount="5" CommentCount="11" FavoriteCount="33" />
  4.   <row Id="3" PostTypeId="1" CreationDate="2011-01-03T20:48:58.913" Score="25" ViewCount="768" Body="&lt;p&gt;I used to label columns in my databases like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user_id&#xA;user_name&#xA;user_password_hash&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To avoid conflicts when joining two tables, but then I learnt some more on how to alias tables, and I stopped doing this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is an effective way of labeling columns in a database? Why?&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="97" LastEditDate="2011-01-06T11:30:53.230" LastActivityDate="2013-01-22T19:43:56.357" Title="What is an effective way of labeling columns in a database?" Tags="&lt;database-design&gt;&lt;erd&gt;" AnswerCount="10" CommentCount="4" FavoriteCount="11" />
  5.   <row Id="4" PostTypeId="2" ParentId="2" CreationDate="2011-01-03T20:49:46.387" Score="44" Body="&lt;p&gt;just a couple of minutes ago I was checking this: &lt;a href=&quot;;&gt;A table that should exist in all projects with a database&lt;/a&gt;, seems simple enough to put in practice, check it out:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It’s called schema_version (or migrations, or whatever suits you) and its purpose is to keep track of structural or data changes to the database.&#xA;  A possible structure (example in MySQL) is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;create table schema_version (&#xA;     `when` timestamp not null default CURRENT_TIMESTAMP,&#xA;     `key` varchar(256) not null,&#xA;     `extra` varchar(256),&#xA;     primary key (`key`)&#xA;) ENGINE=InnoDB;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;insert into schema_version(&lt;code&gt;key&lt;/code&gt;, &lt;code&gt;extra&lt;/code&gt;) values ('001', 'schema version');&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Whether you add this table from the beggining of the project or just after you’ve deployed the first version to a staging or production server is up to you.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Whenever you need to execute an SQL script to change the database structure or perform a data migration you should be adding a row in that table as well. And do that via an insert statement at the begining or end of that script (which is committed to the project’s code repository).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;…&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="18" LastEditorUserId="1396" LastEditDate="2013-09-23T07:14:01.600" LastActivityDate="2013-09-23T07:14:01.600" CommentCount="3" />
  6. </posts>
RAW Paste Data Copied