<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Saku-Saku</author_name>
  <author_url>https://blog.hatena.ne.jp/Saku-Saku/</author_url>
  <blog_title>SakuraWi - BLog</blog_title>
  <blog_url>https://sakurawi.hateblo.jp/</blog_url>
  <categories>
    <anon>技術</anon>
    <anon>技術-RubyonRails</anon>
    <anon>技術-SQL</anon>
  </categories>
  <description>rails db:seedをした時に毎回テーブルの中身を初期化する処理を書く。 code ActiveRecord::Base.establish_connection ActiveRecord::Base.connection.disable_referential_integrity do ActiveRecord::Base.connection.tables.each do |table| next if table == 'schema_migrations' ActiveRecord::Base.connection.execute(&quot;TRUNCATE TABLE `#{table…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsakurawi.hateblo.jp%2Fentry%2Fseed-initialize&quot; title=&quot;seed.rbでテーブルの初期化をする 【MySQL】 - SakuraWi - BLog&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-06-07 02:24:08</published>
  <title>seed.rbでテーブルの初期化をする 【MySQL】</title>
  <type>rich</type>
  <url>https://sakurawi.hateblo.jp/entry/seed-initialize</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
