Update annotations

approved

#1

Update annotations

diff --git a/app/models/badge.rb b/app/models/badge.rb
index 117f27c..3f559a9 100644
--- a/app/models/badge.rb
+++ b/app/models/badge.rb
@@ -252,7 +252,7 @@ end
 # Table name: badges
 #
 #  id                :integer          not null, primary key
-#  name              :string           not null
+#  name              :string(255)      not null
 #  description       :text
 #  badge_type_id     :integer          not null
 #  grant_count       :integer          default(0), not null
@@ -260,7 +260,7 @@ end
 #  updated_at        :datetime         not null
 #  allow_title       :boolean          default(FALSE), not null
 #  multiple_grant    :boolean          default(FALSE), not null
-#  icon              :string           default("fa-certificate")
+#  icon              :string(255)      default("fa-certificate")
 #  listable          :boolean          default(TRUE)
 #  target_posts      :boolean          default(FALSE)
 #  query             :text
@@ -275,6 +275,5 @@ end
 #
 # Indexes
 #
-#  index_badges_on_badge_type_id  (badge_type_id)
-#  index_badges_on_name           (name) UNIQUE
+#  index_badges_on_name  (name) UNIQUE
 #
diff --git a/app/models/badge_grouping.rb b/app/models/badge_grouping.rb
index 4fdcef6..f1201e7 100644
--- a/app/models/badge_grouping.rb
+++ b/app/models/badge_grouping.rb
@@ -22,7 +22,7 @@ end
 # Table name: badge_groupings
 #
 #  id          :integer          not null, primary key
-#  name        :string           not null
+#  name        :string(255)      not null
 #  description :text
 #  position    :integer          not null
 #  created_at  :datetime         not null
diff --git a/app/models/badge_type.rb b/app/models/badge_type.rb
index b1d6e91..4648e3a 100644
--- a/app/models/badge_type.rb
+++ b/app/models/badge_type.rb
@@ -12,7 +12,7 @@ end
 # Table name: badge_types
 #
 #  id         :integer          not null, primary key
-#  name       :string           not null
+#  name       :string(255)      not null
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
 #
diff --git a/app/models/category.rb b/app/models/category.rb
index 955fce7..117ea2f 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -634,7 +634,7 @@ end
 #
 #  id                                :integer          not null, primary key
 #  name                              :string(50)       not null
-#  color                             :string(6)        default("0088CC"), not null
+#  color                             :string(6)        default("AB9364"), not null
 #  topic_id                          :integer
 #  topic_count                       :integer          default(0), not null
 #  created_at                        :datetime         not null
@@ -643,7 +643,7 @@ end
 #  topics_year                       :integer          default(0)
 #  topics_month                      :integer          default(0)
 #  topics_week                       :integer          default(0)
-#  slug                              :string           not null
+#  slug                              :string(255)      not null
 #  description                       :text
 #  text_color                        :string(6)        default("FFFFFF"), not null
 #  read_restricted                   :boolean          default(FALSE), not null
@@ -656,7 +656,7 @@ end
 #  posts_year                        :integer          default(0)
 #  posts_month                       :integer          default(0)
 #  posts_week                        :integer          default(0)
-#  email_in                          :string
+#  email_in                          :string(255)
 #  email_in_allow_strangers          :boolean          default(FALSE)
 #  topics_day                        :integer          default(0)
 #  posts_day                         :integer          default(0)
@@ -678,12 +678,12 @@ end
 #  default_top_period                :string(20)       default("all")
 #  mailinglist_mirror                :boolean          default(FALSE), not null
 #  suppress_from_latest              :boolean          default(FALSE)
-#  minimum_required_tags             :integer          default(0)
+#  minimum_required_tags             :integer          default(0), not null
 #  navigate_to_first_post_after_read :boolean          default(FALSE), not null
 #
 # Indexes
 #
-#  index_categories_on_email_in     (email_in) UNIQUE
-#  index_categories_on_topic_count  (topic_count)
-#  unique_index_categories_on_name  (COALESCE(parent_category_id, '-1'::integer), name) UNIQUE
+#  index_categories_on_email_in            (email_in) UNIQUE
+#  index_categories_on_forum_thread_count  (topic_count)
+#  unique_index_categories_on_name         (COALESCE(parent_category_id, '-1'::integer), name) UNIQUE
 #
diff --git a/app/models/category_tag.rb b/app/models/category_tag.rb
index 507d13e..20ab52d 100644
--- a/app/models/category_tag.rb
+++ b/app/models/category_tag.rb
@@ -10,8 +10,8 @@ end
 #  id          :integer          not null, primary key
 #  category_id :integer          not null
 #  tag_id      :integer          not null
-#  created_at  :datetime         not null
-#  updated_at  :datetime         not null
+#  created_at  :datetime
+#  updated_at  :datetime
 #
 # Indexes
 #
diff --git a/app/models/category_tag_group.rb b/app/models/category_tag_group.rb
index c262539..3c642d3 100644
--- a/app/models/category_tag_group.rb
+++ b/app/models/category_tag_group.rb
@@ -10,8 +10,8 @@ end
 #  id           :integer          not null, primary key
 #  category_id  :integer          not null
 #  tag_group_id :integer          not null
-#  created_at   :datetime         not null
-#  updated_at   :datetime         not null
+#  created_at   :datetime
+#  updated_at   :datetime
 #
 # Indexes
 #
diff --git a/app/models/child_theme.rb b/app/models/child_theme.rb
index c281f87..f0d7e11 100644
--- a/app/models/child_theme.rb
+++ b/app/models/child_theme.rb
@@ -23,8 +23,8 @@ end
 #  id              :integer          not null, primary key
 #  parent_theme_id :integer
 #  child_theme_id  :integer
-#  created_at      :datetime         not null
-#  updated_at      :datetime         not null
+#  created_at      :datetime
+#  updated_at      :datetime
 #
 # Indexes
 #
diff --git a/app/models/color_scheme.rb b/app/models/color_scheme.rb
index 526b2a0..07b9132 100644
--- a/app/models/color_scheme.rb
+++ b/app/models/color_scheme.rb
@@ -280,7 +280,7 @@ end
 # Table name: color_schemes
 #
 #  id             :integer          not null, primary key
-#  name           :string           not null
+#  name           :string(255)      not null
 #  version        :integer          default(1), not null
 #  created_at     :datetime         not null
 #  updated_at     :datetime         not null
diff --git a/app/models/color_scheme_color.rb b/app/models/color_scheme_color.rb
index 51e0c4a..39a7b51 100644
--- a/app/models/color_scheme_color.rb
+++ b/app/models/color_scheme_color.rb
@@ -9,8 +9,8 @@ end
 # Table name: color_scheme_colors
 #
 #  id              :integer          not null, primary key
-#  name            :string           not null
-#  hex             :string           not null
+#  name            :string(255)      not null
+#  hex             :string(255)      not null
 #  color_scheme_id :integer          not null
 #  created_at      :datetime         not null
 #  updated_at      :datetime         not null
diff --git a/app/models/draft.rb b/app/models/draft.rb
index 9905cbe..04e38f5 100644
--- a/app/models/draft.rb
+++ b/app/models/draft.rb
@@ -104,7 +104,7 @@ end
 #
 #  id         :integer          not null, primary key
 #  user_id    :integer          not null
-#  draft_key  :string           not null
+#  draft_key  :string(255)      not null
 #  data       :text             not null
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
diff --git a/app/models/draft_sequence.rb b/app/models/draft_sequence.rb
index 9629e84..ba5c901 100644
--- a/app/models/draft_sequence.rb
+++ b/app/models/draft_sequence.rb

[... diff too long, it was truncated ...]

GitHub sha: a3839495


#2

#3

This doesn’t match up with a fresh migrated database, did you run this on an older database @eviltrout? :thinking:

rake db:drop db:create db:migrate
annotate

Gives me a very different result to this commit. For example, all of the created_at/updated_at fields should have not_null constraints. I think these discrepancies are a result of Rails/ActiveRecord changes over the years.


#5

#7

I used a dump from try.discourse.org so that could indeed be it :frowning:

I wonder if we need migrations for those old sites?

I’ll update it again from a fresh database, thanks for the head’s up.


#8

It would be interesting to extract the schemas from a number of sites and see how different they really are… I’ll add it to my list to attempt at some point


#9

Follow up here, I think it mostly reverts it, oops!


#10