<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nainaistar</author_name>
  <author_url>https://blog.hatena.ne.jp/nainaistar/</author_url>
  <blog_title>きり丸の技術日記</blog_title>
  <blog_url>https://nainaistar.hatenablog.com/</blog_url>
  <categories>
    <anon>DB</anon>
    <anon>技術</anon>
  </categories>
  <description>始めに レコードの有効期間を表示したいときに、start_at, end_atのカラムを用いて表現していました。そして、end_atがnullの場合にアクティブなレコードとして表現しようとしていました。しかし、このやり方ではデータの管理方法に失敗するとアクティブなレコードが複数できてしまう可能性があります。 そのため、アクティブなレコードを1つだけに絞りたかったので、別の主キー + end_atでアクティブなレコードであること表現しようとしました。 しかし、その方法がうまくいかなかったので、同じ轍を踏まないようにブログに残しておきます。 環境 MySQL 8.0 PostgreSQL 17.2…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnainaistar.hatenablog.com%2Fentry%2Fnull-is-undefined-in-db&quot; title=&quot;nullは不明値なのでnullで一意制約をかけられない - きり丸の技術日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/n/nainaistar/20241201/20241201210817.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-12-02 12:00:00</published>
  <title>nullは不明値なのでnullで一意制約をかけられない</title>
  <type>rich</type>
  <url>https://nainaistar.hatenablog.com/entry/null-is-undefined-in-db</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
