<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/atom.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Posts tagged: alembic</title>
  <id>https://waylonwalker.com/tags/alembic/atom.xml</id>
  <updated>2023-08-05T01:25:07Z</updated>
  <subtitle>All posts with the tag &#34;alembic&#34;</subtitle>
  <link href="https://waylonwalker.com/tags/alembic/" rel="alternate" type="text/html"></link>
  <link href="https://waylonwalker.com/tags/alembic/atom.xml" rel="self" type="application/atom+xml"></link>
  <author>
    <name>Waylon Walker</name>
  </author>
  <generator uri="https://github.com/WaylonWalker/markata-go">markata-go</generator>
  <entry>
    <title>💭 `ValueError: Constraint must have a name` in alembic 1.10.0 · ...</title>
    <id>https://waylonwalker.com/thought-71/</id>
    <updated>2023-08-05T01:25:07Z</updated>
    <published>2023-08-05T01:25:07Z</published>
    <link href="https://waylonwalker.com/thought-71/" rel="alternate" type="text/html"></link>
    <summary type="text">!https://github.com/sqlalchemy/alembic/issues/1195</summary>
    <content type="html">&lt;div class=&#34;embed-card embed-card-external&#34;&gt;&#xA;  &lt;a href=&#34;https://github.com/sqlalchemy/alembic/issues/1195&#34; class=&#34;embed-card-link&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &lt;div class=&#34;embed-card-image&#34;&gt;&#xA;      &lt;img class=&#34;glightbox&#34; src=&#34;https://opengraph.githubassets.com/bb02b91b671faac0db0047bb0b8d3886debbe893813cf6ef68ecddbd0932a469/sqlalchemy/alembic/issues/1195&#34; alt=&#34;`ValueError: Constraint must have a name` in alembic 1.10.0 · Issue #1195 · sqlalchemy/alembic — Describe the bug ValueError: Constraint must have a name in alembic 1.10.0. Expected behavior Migration succeeds. To Reproduce Please try to provide a Minimal, Complete, and Verifiable example, wit...&#34; loading=&#34;lazy&#34;/ data-glightbox=&#34;description: `ValueError: Constraint must have a name` in alembic 1.10.0 · Issue #1195 · sqlalchemy/alembic — Describe the bug ValueError: Constraint must have a name in alembic 1.10.0. Expected behavior Migration succeeds. To Reproduce Please try to provide a Minimal, Complete, and Verifiable example, wit...&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &lt;div class=&#34;embed-card-content&#34;&gt;&#xA;      &lt;div class=&#34;embed-card-title&#34;&gt;`ValueError: Constraint must have a name` in alembic 1.10.0 · Issue #1195 · sqlalchemy/alembic&lt;/div&gt;&#xA;      &lt;div class=&#34;embed-card-description&#34;&gt;Describe the bug ValueError: Constraint must have a name in alembic 1.10.0. Expected behavior Migration succeeds. To Reproduce Please try to provide a Minimal, Complete, and Verifiable example, wit...&lt;/div&gt;&#xA;      &lt;div class=&#34;embed-card-meta&#34;&gt;GitHub · github.com&lt;/div&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;After a nasty time with alembic upgrades, thoughts is about to get a new users table.  This may have came from incorrectly setting up alembic for sqlite from the start, but I was able to fix the issue with this GitHub issue.&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;alembic&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sqlite&lt;/span&gt; &lt;span class=&#34;ne&#34;&gt;ValueError&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Constraint&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;must&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;have&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The change I needed to make to get my migration to run.&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        + batch_op.create_foreign_key(&amp;#39;fk_post_author_id_user&amp;#39;, &amp;#39;user&amp;#39;, [&amp;#39;author_id&amp;#39;], [&amp;#39;id&amp;#39;])&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&#34;admonition note&#34;&gt;&#xA;&lt;p class=&#34;admonition-title&#34;&gt;Note&lt;/p&gt;&#xA;&lt;p&gt;This post is a &lt;a href=&#34;/thoughts/&#34; class=&#34;wikilink&#34; data-title=&#34;Thoughts&#34; data-description=&#34;These are generally my thoughts on a web page or some sort of url, except a rare few don&amp;#39;t have a link. These are dual published off of my...&#34; data-date=&#34;2024-04-01&#34; data-preview=&#34;These are generally my thoughts on a web page or some sort of url, except a rare few don&amp;#39;t have a link. These are dual published off of my...&#34;&gt;thought&lt;/a&gt;. It’s a short note that I make&#xA;about someone else’s content online &lt;a href=&#34;/tags/thoughts/&#34; class=&#34;hashtag-tag&#34; data-tag=&#34;thoughts&#34; data-count=&#34;2&#34; data-reading-time=&#34;3&#34; data-reading-time-text=&#34;3 minutes&#34;&gt;#thoughts&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;</content>
    <author>
      <name>Waylon Walker</name>
      <email>hello@waylonwalker.com</email>
      <uri>https://waylonwalker.com</uri>
    </author>
  </entry>
  <entry>
    <title>💭 Use Alembic Check to check for possible upgrades</title>
    <id>https://waylonwalker.com/thought-70/</id>
    <updated>2023-08-05T01:22:06Z</updated>
    <published>2023-08-05T01:22:06Z</published>
    <link href="https://waylonwalker.com/thought-70/" rel="alternate" type="text/html"></link>
    <summary type="text">!None</summary>
    <content type="html">&lt;!-- embed not found: None --&gt;&#xA;&lt;p&gt;![[None]]&lt;/p&gt;&#xA;&lt;p&gt;Since using alembic I have been just running out a new revision checking its content and deleting it if its empty, today I learned there is an &lt;code&gt;alembic check&lt;/code&gt; command to check for operations that need to be created.&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;❯ alembic check&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;INFO  &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;alembic.runtime.migration&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; Context impl SQLiteImpl.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;INFO  &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;alembic.runtime.migration&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; Will assume non-transactional DDL.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;No new upgrade operations detected.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&#34;admonition note&#34;&gt;&#xA;&lt;p class=&#34;admonition-title&#34;&gt;Note&lt;/p&gt;&#xA;&lt;p&gt;This post is a &lt;a href=&#34;/thoughts/&#34; class=&#34;wikilink&#34; data-title=&#34;Thoughts&#34; data-description=&#34;These are generally my thoughts on a web page or some sort of url, except a rare few don&amp;#39;t have a link. These are dual published off of my...&#34; data-date=&#34;2024-04-01&#34; data-preview=&#34;These are generally my thoughts on a web page or some sort of url, except a rare few don&amp;#39;t have a link. These are dual published off of my...&#34;&gt;thought&lt;/a&gt;. It’s a short note that I make&#xA;about someone else’s content online &lt;a href=&#34;/tags/thoughts/&#34; class=&#34;hashtag-tag&#34; data-tag=&#34;thoughts&#34; data-count=&#34;2&#34; data-reading-time=&#34;3&#34; data-reading-time-text=&#34;3 minutes&#34;&gt;#thoughts&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;</content>
    <author>
      <name>Waylon Walker</name>
      <email>hello@waylonwalker.com</email>
      <uri>https://waylonwalker.com</uri>
    </author>
  </entry>
</feed>