# Database Tags

**URL:** <https://forum.liquibase.org/t/database-tags/310>\
**Category:** General Discussion\
**Created:** [October 21, 2009, 6:02am UTC](https://forum.liquibase.org/t/database-tags/310 "2009-10-21T06:02:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hopfrog\_lb](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@hopfrog\_lb](https://forum.liquibase.org/u/hopfrog_lb)\
**Post date:** [October 21, 2009, 6:02am UTC](https://forum.liquibase.org/t/database-tags/310/1 "2009-10-21T06:02:00Z")

</div>

If I have a changeset file like so:

&nbsp; &nbsp; 

Should I not have two tags in my database upon execution?

Currently I only see the last tag in the DATABASECHANGELOG table.&nbsp; Is that how it is supposed to work?&nbsp;

~hf

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [October 21, 2009, 6:02am UTC](https://forum.liquibase.org/t/database-tags/310/2 "2009-10-21T06:02:00Z")

</div>

If you run “select \* from databasechangelog where tag is not null” what do you get back?

Nathan

---

<div class="post-metadata">

**Author:** ![neelabhro](https://avatars.discourse-cdn.com/v4/letter/n/ecccb3/32.png) [@neelabhro](https://forum.liquibase.org/u/neelabhro)\
**Post date:** [October 21, 2009, 6:02am UTC](https://forum.liquibase.org/t/database-tags/310/3 "2009-10-21T06:02:00Z")

</div>

I see the same problem too … Here is the content of master.xml

&nbsp;   
&nbsp;   
&nbsp;   
&nbsp;

However select \* from DATABASECHANGELOG shows the following …

mysql\> select \* from DATABASECHANGELOG;  
±----±-------±----------------------------------------------------------------------------±--------------------±--------------±---------±-----------------------------------±--------------±------------------------------------±-----±----------+  
| ID&nbsp; | AUTHOR | FILENAME&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | DATEEXECUTED&nbsp; &nbsp; &nbsp; | ORDEREXECUTED&nbsp; | EXECTYPE&nbsp; | MD5SUM&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | DESCRIPTION&nbsp; &nbsp; &nbsp; | TAG&nbsp; | LIQUIBASE |  
±----±-------±----------------------------------------------------------------------------±--------------------±--------------±---------±-----------------------------------±--------------±------------------------------------±-----±----------+  
| 1&nbsp; | neel&nbsp; | my-changelog-master.xml&nbsp; | 2011-02-01 18:48:48 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 | EXECUTED | 3:c83c182e7796a0b547e2251c7975eb1d | Tag Database&nbsp; &nbsp; &nbsp; |&nbsp; 46.0&nbsp; | 2.0.0&nbsp; &nbsp; |  
| 2&nbsp; | neel&nbsp; | db-changelog-1.0.xml&nbsp; &nbsp; &nbsp; &nbsp; | 2011-02-01 18:48:48 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3 | EXECUTED | 3:90872551b03195302caa87c4c464d8a0 |&nbsp; Rename Column |&nbsp; 46.0&nbsp; | 2.0.0&nbsp; &nbsp; |  
| 3&nbsp; | neel&nbsp; | my-changelog-master.xml&nbsp; | 2011-02-01 18:48:48 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4&nbsp; | EXECUTED | 3:6cbff2d7852eaa3de230abf82d94928e&nbsp; &nbsp; | Tag Database&nbsp; &nbsp; &nbsp; |&nbsp; 46.0&nbsp; |&nbsp; 2.0.0&nbsp; &nbsp; |  
| 4&nbsp; | neel&nbsp; | db-changelog-2.0.xml&nbsp; &nbsp; &nbsp; &nbsp; | 2011-02-01 18:48:49 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 5 | EXECUTED | 3:2ae0a801b37adc2f02366755f4d1326e&nbsp; | Create Table&nbsp; &nbsp; &nbsp; &nbsp; | NULL |&nbsp; 2.0.0&nbsp; &nbsp; |  
±----±-------±----------------------------------------------------------------------------±--------------------±--------------±---------±-----------------------------------±--------------±------------------------------------±-----±----------+

Should’nt I have a tag of 45.0 and 46.0 ? Since all tags are marked with the last tag … I can use rollback only for the first tag.

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [October 21, 2009, 6:02am UTC](https://forum.liquibase.org/t/database-tags/310/4 "2009-10-21T06:02:00Z")

</div>

It is related to [http://liquibase.jira.com/browse/CORE-842](http://liquibase.jira.com/browse/CORE-842) which is something that needs to be fixed for 2.0.2.&nbsp;

Basically, liquibasedoes a update tag set tag=? where dateexecuted=(select max(dateexecuted) from databasechangelog).&nbsp; That works, as longa s the newest dateexecuted value doesn’t have multiple rows with the value.&nbsp; This happens when there is a bunch of fast changeSets executed that take less time than the granularity of the dateexecuted datatype.&nbsp; With 2.0, there is now an orderexecuted column we can also order by to make sure that only the most recent row is tagged.

Nathan
