<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">The "info" attribute is ignored when copying columns from declarative mixins.</p>
<hr>
<p dir="auto">Attachments: <a href="../wiki/imported_issue_attachments/2025/infonotcopied.py">infonotcopied.py</a></p>
<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">(original reporter: sparticvs) Hello, first let me start by apologizing should this be a duplicate. I did some hunting through titles to see if anything seemed like it would be the same, but I didn't see anything specific, so here we go.</p>
<p dir="auto">Using the following example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sqlalchemy import Column, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.dialects.mysql import TIMESTAMP, BIGINT, INTEGER, BOOLEAN
from sqlalchemy.sql import func
Base = declarative_base()
class Alpha(Base):
     __tablename__ = 'alpha'
     __table_args__ = {'mysql_engine':'MyISAM', 'mysql_charset': 'utf8', 'mysql_collate': 'utf8_unicode_ci'}
     alpha_id = Column(BIGINT(unsigned=True), autoincrement=True, primary_key=True, unique=True, nullable=False)
     beta_id = Column(BIGINT(unsigned=True), nullable=False)
     charlie_id = Column(INTEGER(unsigned=True), nullable=False)
     inserted_time = Column(TIMESTAMP, nullable=False, default=func.current_timestamp())
     alpha_state = Column(BOOLEAN, nullable=False, default=False)

engine = create_engine('mysql://root@localhost/sa_test_db', echo=True)
Base.metadata.create_all(engine)"><pre class="notranslate"><code class="notranslate">from sqlalchemy import Column, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.dialects.mysql import TIMESTAMP, BIGINT, INTEGER, BOOLEAN
from sqlalchemy.sql import func
Base = declarative_base()
class Alpha(Base):
     __tablename__ = 'alpha'
     __table_args__ = {'mysql_engine':'MyISAM', 'mysql_charset': 'utf8', 'mysql_collate': 'utf8_unicode_ci'}
     alpha_id = Column(BIGINT(unsigned=True), autoincrement=True, primary_key=True, unique=True, nullable=False)
     beta_id = Column(BIGINT(unsigned=True), nullable=False)
     charlie_id = Column(INTEGER(unsigned=True), nullable=False)
     inserted_time = Column(TIMESTAMP, nullable=False, default=func.current_timestamp())
     alpha_state = Column(BOOLEAN, nullable=False, default=False)

engine = create_engine('mysql://root@localhost/sa_test_db', echo=True)
Base.metadata.create_all(engine)
</code></pre></div>
<p dir="auto">And according to the echo that executes:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="CREATE TABLE alpha (
        alpha_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
        beta_id BIGINT UNSIGNED NOT NULL,
        charlie_id INTEGER UNSIGNED NOT NULL,
        inserted_time TIMESTAMP,
        alpha_state BOOL NOT NULL,
        PRIMARY KEY (alpha_id),
        UNIQUE (alpha_id),
        CHECK (alpha_state IN (0, 1))
)ENGINE=MyISAM CHARSET=utf8 COLLATE utf8_unicode_ci"><pre class="notranslate"><code class="notranslate">CREATE TABLE alpha (
        alpha_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
        beta_id BIGINT UNSIGNED NOT NULL,
        charlie_id INTEGER UNSIGNED NOT NULL,
        inserted_time TIMESTAMP,
        alpha_state BOOL NOT NULL,
        PRIMARY KEY (alpha_id),
        UNIQUE (alpha_id),
        CHECK (alpha_state IN (0, 1))
)ENGINE=MyISAM CHARSET=utf8 COLLATE utf8_unicode_ci
</code></pre></div>
<p dir="auto">However this is not same as what I stated above as a show create table shows the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mysql&gt; show create table alpha;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                        |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| alpha | CREATE TABLE `alpha` (
  `alpha_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `beta_id` bigint(20) unsigned NOT NULL,
  `charlie_id` int(10) unsigned NOT NULL,
  `inserted_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `alpha_state` tinyint(1) NOT NULL,
  PRIMARY KEY (`alpha_id`),
  UNIQUE KEY `alpha_id` (`alpha_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)"><pre class="notranslate"><code class="notranslate">mysql&gt; show create table alpha;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                        |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| alpha | CREATE TABLE `alpha` (
  `alpha_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `beta_id` bigint(20) unsigned NOT NULL,
  `charlie_id` int(10) unsigned NOT NULL,
  `inserted_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `alpha_state` tinyint(1) NOT NULL,
  PRIMARY KEY (`alpha_id`),
  UNIQUE KEY `alpha_id` (`alpha_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
</code></pre></div>
<p dir="auto">However if you set <code class="notranslate">inserted_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP</code> (which is representative of the Column declaration above) this doesn't create the ON UPDATE.</p>
<p dir="auto">Therefore, that said, I propose that when a Column with the type of TIMESTAMP has a default value of func.now() or func.current_timestamp() that it is explicitly created as such in a MySQL table.</p>
<p dir="auto">Thank you.</p>