Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <posts>
- <row Id="1" PostTypeId="1" CreationDate="2011-01-03T20:46:02.927" Score="180" ViewCount="172059" Body="<p>What are the main differences between InnoDB and MyISAM?</p>
" OwnerUserId="8" LastActivityDate="2017-03-09T13:33:47.627" Title="What are the main differences between InnoDB and MyISAM?" Tags="<mysql><innodb><myisam>" AnswerCount="10" CommentCount="1" FavoriteCount="105" />
- <row Id="2" PostTypeId="1" AcceptedAnswerId="4" CreationDate="2011-01-03T20:46:32.393" Score="63" ViewCount="8595" Body="<p>What version control methodologies help teams of people track database schema changes?</p>
" 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="<mysql><version-control><schema>" AnswerCount="5" CommentCount="11" FavoriteCount="33" />
- <row Id="3" PostTypeId="1" CreationDate="2011-01-03T20:48:58.913" Score="25" ViewCount="768" Body="<p>I used to label columns in my databases like this:</p>

<pre><code>user_id
user_name
user_password_hash
</code></pre>

<p>To avoid conflicts when joining two tables, but then I learnt some more on how to alias tables, and I stopped doing this. </p>

<p>What is an effective way of labeling columns in a database? Why?</p>
" 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="<database-design><erd>" AnswerCount="10" CommentCount="4" FavoriteCount="11" />
- <row Id="4" PostTypeId="2" ParentId="2" CreationDate="2011-01-03T20:49:46.387" Score="44" Body="<p>just a couple of minutes ago I was checking this: <a href="http://blog.cherouvim.com/a-table-that-should-exist-in-all-projects-with-a-database/">A table that should exist in all projects with a database</a>, seems simple enough to put in practice, check it out:</p>

<blockquote>
 <p>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.
 A possible structure (example in MySQL) is:</p>

<pre><code>create table schema_version (
 `when` timestamp not null default CURRENT_TIMESTAMP,
 `key` varchar(256) not null,
 `extra` varchar(256),
 primary key (`key`)
) ENGINE=InnoDB;
</code></pre>
 
 <p>insert into schema_version(<code>key</code>, <code>extra</code>) values ('001', 'schema version');</p>
 
 <p>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.</p>
 
 <p>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).</p>
 
 <p>…</p>
</blockquote>
" OwnerUserId="18" LastEditorUserId="1396" LastEditDate="2013-09-23T07:14:01.600" LastActivityDate="2013-09-23T07:14:01.600" CommentCount="3" />
- </posts>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement