add ck editor file upload endpoint

This commit is contained in:
João Geonizeli
2022-07-21 10:28:07 -03:00
parent ed1ed73ed7
commit 3928da4577
8 changed files with 326 additions and 39 deletions

View File

@@ -23,8 +23,7 @@ gem "redis", "~> 4.0"
gem "bootsnap", require: false
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
gem "image_processing", "~> 1.2"
gem "pundit", "~> 2.2"
gem "enumerize", "~> 2.5"

View File

@@ -130,6 +130,9 @@ GEM
hashie (5.0.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
importmap-rails (1.1.5)
actionpack (>= 6.0.0)
railties (>= 6.0.0)
@@ -168,6 +171,7 @@ GEM
mini_mime (>= 0.1.1)
marcel (1.0.2)
method_source (1.0.0)
mini_magick (4.11.0)
mini_mime (1.1.2)
minitest (5.16.2)
msgpack (1.5.3)
@@ -279,6 +283,8 @@ GEM
rspec-support (3.11.0)
ruby-graphviz (1.2.5)
rexml
ruby-vips (2.1.4)
ffi (~> 1.12)
ruby2_keywords (0.0.5)
sassc (2.4.0)
ffi (~> 1.9)
@@ -334,6 +340,7 @@ DEPENDENCIES
enumerize (~> 2.5)
factory_bot_rails (~> 6.2)
faker (~> 2.21)
image_processing (~> 1.2)
importmap-rails
jbuilder
omniauth (~> 1.9.1)

View File

@@ -0,0 +1,14 @@
class CkEditorUploadsController < ApplicationController
def create
@upload = CkEditorUpload.new(attachment: params[:attachment])
if @upload.save!
render(json: {
uploaded: true,
url: rails_blob_url(@upload.attachment, only_path: false),
})
else
render(json: { uploaded: false })
end
end
end

View File

@@ -0,0 +1,11 @@
# == Schema Information
#
# Table name: ck_editor_uploads
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
#
class CkEditorUpload < ApplicationRecord
has_one_attached :attachment
end

View File

@@ -0,0 +1,7 @@
class CreateCkEditorUploads < ActiveRecord::Migration[7.0]
def change
create_table :ck_editor_uploads do |t|
t.timestamps
end
end
end

View File

@@ -0,0 +1,57 @@
# This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
def change
# Use Active Record's configured type for primary and foreign keys
primary_key_type, foreign_key_type = primary_and_foreign_key_types
create_table :active_storage_blobs, id: primary_key_type do |t|
t.string :key, null: false
t.string :filename, null: false
t.string :content_type
t.text :metadata
t.string :service_name, null: false
t.bigint :byte_size, null: false
t.string :checksum
if connection.supports_datetime_with_precision?
t.datetime :created_at, precision: 6, null: false
else
t.datetime :created_at, null: false
end
t.index [ :key ], unique: true
end
create_table :active_storage_attachments, id: primary_key_type do |t|
t.string :name, null: false
t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
t.references :blob, null: false, type: foreign_key_type
if connection.supports_datetime_with_precision?
t.datetime :created_at, precision: 6, null: false
else
t.datetime :created_at, null: false
end
t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
create_table :active_storage_variant_records, id: primary_key_type do |t|
t.belongs_to :blob, null: false, index: false, type: foreign_key_type
t.string :variation_digest, null: false
t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
end
private
def primary_and_foreign_key_types
config = Rails.configuration.generators
setting = config.options[config.orm][:primary_key_type]
primary_key_type = setting || :primary_key
foreign_key_type = setting || :bigint
[primary_key_type, foreign_key_type]
end
end

37
db/schema.rb generated
View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2022_07_21_124944) do
ActiveRecord::Schema[7.0].define(version: 2022_07_21_132556) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -28,6 +28,34 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_21_124944) do
t.index ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource"
end
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end
create_table "active_storage_blobs", force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.string "service_name", null: false
t.bigint "byte_size", null: false
t.string "checksum"
t.datetime "created_at", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
create_table "active_storage_variant_records", force: :cascade do |t|
t.bigint "blob_id", null: false
t.string "variation_digest", null: false
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
create_table "axes", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
@@ -42,6 +70,11 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_21_124944) do
t.index ["name"], name: "index_categories_on_name", unique: true
end
create_table "ck_editor_uploads", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "questions", force: :cascade do |t|
t.bigint "user_id", null: false
t.bigint "subject_id"
@@ -88,6 +121,8 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_21_124944) do
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "questions", "subjects"
add_foreign_key "questions", "users"
add_foreign_key "subjects", "axes"

229
erd.svg
View File

@@ -4,49 +4,206 @@
<!-- Generated by graphviz version 4.0.0 (0)
-->
<!-- Title: ProgressTest Pages: 1 -->
<svg width="416pt" height="204pt"
viewBox="0.00 0.00 416.10 203.60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(28.8 174.8)">
<svg width="965pt" height="598pt"
viewBox="0.00 0.00 965.10 597.60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(28.8 568.8)">
<title>ProgressTest</title>
<polygon fill="white" stroke="transparent" points="-28.8,28.8 -28.8,-174.8 387.3,-174.8 387.3,28.8 -28.8,28.8"/>
<text text-anchor="middle" x="179.25" y="-131.6" font-family="Arial Bold" font-size="13.00">Progress Test &#45; Models</text>
<polygon fill="white" stroke="transparent" points="-28.8,28.8 -28.8,-568.8 936.3,-568.8 936.3,28.8 -28.8,28.8"/>
<text text-anchor="middle" x="453.75" y="-525.6" font-family="Arial Bold" font-size="13.00">Progress Test &#45; Models</text>
<!-- m_ActiveAdmin::Comment -->
<g id="node1" class="node">
<title>m_ActiveAdmin::Comment</title>
<path fill="none" stroke="black" d="M12,-0.5C12,-0.5 132,-0.5 132,-0.5 138,-0.5 144,-6.5 144,-12.5 144,-12.5 144,-96.5 144,-96.5 144,-102.5 138,-108.5 132,-108.5 132,-108.5 12,-108.5 12,-108.5 6,-108.5 0,-102.5 0,-96.5 0,-96.5 0,-12.5 0,-12.5 0,-6.5 6,-0.5 12,-0.5"/>
<text text-anchor="start" x="6.5" y="-95.7" font-family="Arial Bold" font-size="11.00">ActiveAdmin::Comment</text>
<polyline fill="none" stroke="black" points="0,-88.5 144,-88.5 "/>
<text text-anchor="start" x="7" y="-75.5" font-family="Arial" font-size="10.00">author_id </text>
<text text-anchor="start" x="50" y="-75.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8)</text>
<text text-anchor="start" x="7" y="-62.5" font-family="Arial" font-size="10.00">author_type </text>
<text text-anchor="start" x="62" y="-62.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="7" y="-49.5" font-family="Arial" font-size="10.00">body </text>
<text text-anchor="start" x="32" y="-49.5" font-family="Arial Italic" font-size="10.00" fill="#999999">text</text>
<text text-anchor="start" x="7" y="-36.5" font-family="Arial" font-size="10.00">namespace </text>
<text text-anchor="start" x="61" y="-36.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="7" y="-23.5" font-family="Arial" font-size="10.00">resource_id </text>
<text text-anchor="start" x="61" y="-23.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8)</text>
<text text-anchor="start" x="7" y="-10.5" font-family="Arial" font-size="10.00">resource_type </text>
<text text-anchor="start" x="72" y="-10.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<path fill="none" stroke="black" d="M12,-394.5C12,-394.5 132,-394.5 132,-394.5 138,-394.5 144,-400.5 144,-406.5 144,-406.5 144,-490.5 144,-490.5 144,-496.5 138,-502.5 132,-502.5 132,-502.5 12,-502.5 12,-502.5 6,-502.5 0,-496.5 0,-490.5 0,-490.5 0,-406.5 0,-406.5 0,-400.5 6,-394.5 12,-394.5"/>
<text text-anchor="start" x="6.5" y="-489.7" font-family="Arial Bold" font-size="11.00">ActiveAdmin::Comment</text>
<polyline fill="none" stroke="black" points="0,-482.5 144,-482.5 "/>
<text text-anchor="start" x="7" y="-469.5" font-family="Arial" font-size="10.00">author_id </text>
<text text-anchor="start" x="50" y="-469.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8)</text>
<text text-anchor="start" x="7" y="-456.5" font-family="Arial" font-size="10.00">author_type </text>
<text text-anchor="start" x="62" y="-456.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="7" y="-443.5" font-family="Arial" font-size="10.00">body </text>
<text text-anchor="start" x="32" y="-443.5" font-family="Arial Italic" font-size="10.00" fill="#999999">text</text>
<text text-anchor="start" x="7" y="-430.5" font-family="Arial" font-size="10.00">namespace </text>
<text text-anchor="start" x="61" y="-430.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="7" y="-417.5" font-family="Arial" font-size="10.00">resource_id </text>
<text text-anchor="start" x="61" y="-417.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8)</text>
<text text-anchor="start" x="7" y="-404.5" font-family="Arial" font-size="10.00">resource_type </text>
<text text-anchor="start" x="72" y="-404.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
</g>
<!-- m_ActiveStorage::Attachment -->
<g id="node2" class="node">
<title>m_ActiveStorage::Attachment</title>
<path fill="none" stroke="black" d="M192.5,-72C192.5,-72 321.5,-72 321.5,-72 327.5,-72 333.5,-78 333.5,-84 333.5,-84 333.5,-116 333.5,-116 333.5,-122 327.5,-128 321.5,-128 321.5,-128 192.5,-128 192.5,-128 186.5,-128 180.5,-122 180.5,-116 180.5,-116 180.5,-84 180.5,-84 180.5,-78 186.5,-72 192.5,-72"/>
<text text-anchor="start" x="186" y="-115.2" font-family="Arial Bold" font-size="11.00">ActiveStorage::Attachment</text>
<polyline fill="none" stroke="black" points="180.5,-108 333.5,-108 "/>
<text text-anchor="start" x="192" y="-95" font-family="Arial" font-size="10.00">name </text>
<text text-anchor="start" x="220" y="-95" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="192" y="-82" font-family="Arial" font-size="10.00">record_type </text>
<text text-anchor="start" x="247" y="-82" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
</g>
<!-- m_ActiveStorage::Blob -->
<g id="node3" class="node">
<title>m_ActiveStorage::Blob</title>
<path fill="none" stroke="black" d="M197,-236.5C197,-236.5 317,-236.5 317,-236.5 323,-236.5 329,-242.5 329,-248.5 329,-248.5 329,-345.5 329,-345.5 329,-351.5 323,-357.5 317,-357.5 317,-357.5 197,-357.5 197,-357.5 191,-357.5 185,-351.5 185,-345.5 185,-345.5 185,-248.5 185,-248.5 185,-242.5 191,-236.5 197,-236.5"/>
<text text-anchor="start" x="201.5" y="-344.7" font-family="Arial Bold" font-size="11.00">ActiveStorage::Blob</text>
<polyline fill="none" stroke="black" points="185,-337.5 329,-337.5 "/>
<text text-anchor="start" x="192" y="-324" font-family="Arial" font-size="10.00">byte_size </text>
<text text-anchor="start" x="238" y="-324" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8)</text>
<text text-anchor="start" x="192" y="-311" font-family="Arial" font-size="10.00">checksum </text>
<text text-anchor="start" x="241" y="-311" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="192" y="-298" font-family="Arial" font-size="10.00">content_type </text>
<text text-anchor="start" x="252" y="-298" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="192" y="-285" font-family="Arial" font-size="10.00">filename </text>
<text text-anchor="start" x="232" y="-285" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="192" y="-272" font-family="Arial" font-size="10.00">key </text>
<text text-anchor="start" x="211" y="-272" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="192" y="-259" font-family="Arial" font-size="10.00">metadata </text>
<text text-anchor="start" x="236" y="-259" font-family="Arial Italic" font-size="10.00" fill="#999999">text</text>
<text text-anchor="start" x="192" y="-246" font-family="Arial" font-size="10.00">service_name </text>
<text text-anchor="start" x="256" y="-246" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
</g>
<!-- m_ActiveStorage::Blob&#45;&gt;m_ActiveStorage::Attachment -->
<g id="edge2" class="edge">
<title>m_ActiveStorage::Blob&#45;&gt;m_ActiveStorage::Attachment</title>
<path fill="none" stroke="black" d="M257,-236.43C257,-200.37 257,-156.1 257,-128.21"/>
</g>
<!-- m_ActiveStorage::Blob&#45;&gt;m_ActiveStorage::Blob -->
<g id="edge5" class="edge">
<title>m_ActiveStorage::Blob&#45;&gt;m_ActiveStorage::Blob</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M329.18,-324.51C345.79,-322.14 358,-312.97 358,-297 358,-281.03 345.79,-271.86 329.18,-269.49"/>
</g>
<!-- m_ActiveStorage::VariantRecord -->
<g id="node4" class="node">
<title>m_ActiveStorage::VariantRecord</title>
<path fill="none" stroke="black" d="M185.5,-427C185.5,-427 328.5,-427 328.5,-427 334.5,-427 340.5,-433 340.5,-439 340.5,-439 340.5,-458 340.5,-458 340.5,-464 334.5,-470 328.5,-470 328.5,-470 185.5,-470 185.5,-470 179.5,-470 173.5,-464 173.5,-458 173.5,-458 173.5,-439 173.5,-439 173.5,-433 179.5,-427 185.5,-427"/>
<text text-anchor="start" x="179" y="-457.2" font-family="Arial Bold" font-size="11.00">ActiveStorage::VariantRecord</text>
<polyline fill="none" stroke="black" points="173.5,-450 340.5,-450 "/>
<text text-anchor="start" x="192" y="-436.5" font-family="Arial" font-size="10.00">variation_digest </text>
<text text-anchor="start" x="264" y="-436.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
</g>
<!-- m_ActiveStorage::VariantRecord&#45;&gt;m_ActiveStorage::Attachment -->
<g id="edge3" class="edge">
<title>m_ActiveStorage::VariantRecord&#45;&gt;m_ActiveStorage::Attachment</title>
<path fill="none" stroke="black" d="M227.06,-426.68C206.72,-410.59 181.49,-386.31 170,-358 149.61,-307.76 154.69,-288.02 170,-236 182.2,-194.54 211.52,-153.8 232.76,-128.1"/>
</g>
<!-- m_ActiveStorage::VariantRecord&#45;&gt;m_ActiveStorage::Blob -->
<g id="edge1" class="edge">
<title>m_ActiveStorage::VariantRecord&#45;&gt;m_ActiveStorage::Blob</title>
<path fill="none" stroke="black" d="M257,-426.71C257,-411.06 257,-388.64 257,-366.89"/>
<polygon fill="black" stroke="black" points="260.15,-366.63 257,-357.63 253.85,-366.63 260.15,-366.63"/>
</g>
<!-- m_Axis -->
<g id="node5" class="node">
<title>m_Axis</title>
<path fill="none" stroke="black" d="M474,-427C474,-427 594,-427 594,-427 600,-427 606,-433 606,-439 606,-439 606,-458 606,-458 606,-464 600,-470 594,-470 594,-470 474,-470 474,-470 468,-470 462,-464 462,-458 462,-458 462,-439 462,-439 462,-433 468,-427 474,-427"/>
<text text-anchor="start" x="520" y="-457.2" font-family="Arial Bold" font-size="11.00">Axis</text>
<polyline fill="none" stroke="black" points="462,-450 606,-450 "/>
<text text-anchor="start" x="469" y="-436.5" font-family="Arial" font-size="10.00">name </text>
<text text-anchor="start" x="497" y="-436.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string U</text>
</g>
<!-- m_Subject -->
<g id="node9" class="node">
<title>m_Subject</title>
<path fill="none" stroke="black" d="M561,-275.5C561,-275.5 681,-275.5 681,-275.5 687,-275.5 693,-281.5 693,-287.5 693,-287.5 693,-306.5 693,-306.5 693,-312.5 687,-318.5 681,-318.5 681,-318.5 561,-318.5 561,-318.5 555,-318.5 549,-312.5 549,-306.5 549,-306.5 549,-287.5 549,-287.5 549,-281.5 555,-275.5 561,-275.5"/>
<text text-anchor="start" x="599" y="-305.7" font-family="Arial Bold" font-size="11.00">Subject</text>
<polyline fill="none" stroke="black" points="549,-298.5 693,-298.5 "/>
<text text-anchor="start" x="556" y="-285" font-family="Arial" font-size="10.00">name </text>
<text text-anchor="start" x="584" y="-285" font-family="Arial Italic" font-size="10.00" fill="#999999">string U</text>
</g>
<!-- m_Axis&#45;&gt;m_Subject -->
<g id="edge11" class="edge">
<title>m_Axis&#45;&gt;m_Subject</title>
<path fill="none" stroke="black" d="M546.1,-426.71C561.29,-400.6 587.43,-355.69 604.46,-326.42"/>
<polygon fill="black" stroke="black" points="607.2,-327.97 609.01,-318.61 601.76,-324.81 607.2,-327.97"/>
</g>
<!-- m_Category -->
<g id="node6" class="node">
<title>m_Category</title>
<path fill="none" stroke="black" d="M647,-427C647,-427 767,-427 767,-427 773,-427 779,-433 779,-439 779,-439 779,-458 779,-458 779,-464 773,-470 767,-470 767,-470 647,-470 647,-470 641,-470 635,-464 635,-458 635,-458 635,-439 635,-439 635,-433 641,-427 647,-427"/>
<text text-anchor="start" x="680.5" y="-457.2" font-family="Arial Bold" font-size="11.00">Category</text>
<polyline fill="none" stroke="black" points="635,-450 779,-450 "/>
<text text-anchor="start" x="642" y="-436.5" font-family="Arial" font-size="10.00">name </text>
<text text-anchor="start" x="670" y="-436.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string U</text>
</g>
<!-- m_Category&#45;&gt;m_Subject -->
<g id="edge10" class="edge">
<title>m_Category&#45;&gt;m_Subject</title>
<path fill="none" stroke="black" d="M695.04,-426.71C680.02,-400.6 654.19,-355.69 637.35,-326.42"/>
<polygon fill="black" stroke="black" points="640.07,-324.84 632.86,-318.61 634.61,-327.98 640.07,-324.84"/>
</g>
<!-- m_CkEditorUpload -->
<g id="node7" class="node">
<title>m_CkEditorUpload</title>
<path fill="none" stroke="black" d="M388,-279C388,-279 508,-279 508,-279 514,-279 520,-285 520,-291 520,-291 520,-303 520,-303 520,-309 514,-315 508,-315 508,-315 388,-315 388,-315 382,-315 376,-309 376,-303 376,-303 376,-291 376,-291 376,-285 382,-279 388,-279"/>
<text text-anchor="start" x="403.5" y="-294.2" font-family="Arial Bold" font-size="11.00">CkEditorUpload</text>
</g>
<!-- m_CkEditorUpload&#45;&gt;m_ActiveStorage::Attachment -->
<g id="edge4" class="edge">
<title>m_CkEditorUpload&#45;&gt;m_ActiveStorage::Attachment</title>
<path fill="none" stroke="black" d="M431.05,-278.7C397.73,-244.67 323.46,-168.85 283.56,-128.12"/>
</g>
<!-- m_Question -->
<g id="node8" class="node">
<title>m_Question</title>
<path fill="none" stroke="black" d="M658,-0.5C658,-0.5 778,-0.5 778,-0.5 784,-0.5 790,-6.5 790,-12.5 790,-12.5 790,-187.5 790,-187.5 790,-193.5 784,-199.5 778,-199.5 778,-199.5 658,-199.5 658,-199.5 652,-199.5 646,-193.5 646,-187.5 646,-187.5 646,-12.5 646,-12.5 646,-6.5 652,-0.5 658,-0.5"/>
<text text-anchor="start" x="692" y="-186.7" font-family="Arial Bold" font-size="11.00">Question</text>
<polyline fill="none" stroke="black" points="646,-179.5 790,-179.5 "/>
<text text-anchor="start" x="653" y="-166" font-family="Arial" font-size="10.00">alternatives </text>
<text text-anchor="start" x="707" y="-166" font-family="Arial Italic" font-size="10.00" fill="#999999">jsonb</text>
<text text-anchor="start" x="653" y="-153" font-family="Arial" font-size="10.00">authorship </text>
<text text-anchor="start" x="702" y="-153" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="653" y="-140" font-family="Arial" font-size="10.00">authorship_year </text>
<text text-anchor="start" x="726" y="-140" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="653" y="-127" font-family="Arial" font-size="10.00">bloom_taxonomy </text>
<text text-anchor="start" x="731" y="-127" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="653" y="-114" font-family="Arial" font-size="10.00">body </text>
<text text-anchor="start" x="678" y="-114" font-family="Arial Italic" font-size="10.00" fill="#999999">text</text>
<text text-anchor="start" x="653" y="-101" font-family="Arial" font-size="10.00">check_type </text>
<text text-anchor="start" x="707" y="-101" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="653" y="-88" font-family="Arial" font-size="10.00">difficulty </text>
<text text-anchor="start" x="693" y="-88" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="653" y="-75" font-family="Arial" font-size="10.00">explanation </text>
<text text-anchor="start" x="706" y="-75" font-family="Arial Italic" font-size="10.00" fill="#999999">text</text>
<text text-anchor="start" x="653" y="-62" font-family="Arial" font-size="10.00">instruction </text>
<text text-anchor="start" x="702" y="-62" font-family="Arial Italic" font-size="10.00" fill="#999999">text</text>
<text text-anchor="start" x="653" y="-49" font-family="Arial" font-size="10.00">intention </text>
<text text-anchor="start" x="693" y="-49" font-family="Arial Italic" font-size="10.00" fill="#999999">text</text>
<text text-anchor="start" x="653" y="-36" font-family="Arial" font-size="10.00">references </text>
<text text-anchor="start" x="702" y="-36" font-family="Arial Italic" font-size="10.00" fill="#999999">text</text>
<text text-anchor="start" x="653" y="-23" font-family="Arial" font-size="10.00">status </text>
<text text-anchor="start" x="684" y="-23" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="653" y="-10" font-family="Arial" font-size="10.00">support </text>
<text text-anchor="start" x="689" y="-10" font-family="Arial Italic" font-size="10.00" fill="#999999">text</text>
</g>
<!-- m_Subject&#45;&gt;m_Question -->
<g id="edge8" class="edge">
<title>m_Subject&#45;&gt;m_Question</title>
<path fill="none" stroke="black" d="M631.38,-275.13C639.67,-258.46 651.98,-233.73 664.73,-208.09"/>
<polygon fill="black" stroke="black" points="667.69,-209.21 668.88,-199.75 662.05,-206.4 667.69,-209.21"/>
</g>
<!-- m_User -->
<g id="node2" class="node">
<g id="node10" class="node">
<title>m_User</title>
<path fill="none" stroke="black" d="M185.5,-0.5C185.5,-0.5 346.5,-0.5 346.5,-0.5 352.5,-0.5 358.5,-6.5 358.5,-12.5 358.5,-12.5 358.5,-96.5 358.5,-96.5 358.5,-102.5 352.5,-108.5 346.5,-108.5 346.5,-108.5 185.5,-108.5 185.5,-108.5 179.5,-108.5 173.5,-102.5 173.5,-96.5 173.5,-96.5 173.5,-12.5 173.5,-12.5 173.5,-6.5 179.5,-0.5 185.5,-0.5"/>
<text text-anchor="start" x="251.5" y="-95.7" font-family="Arial Bold" font-size="11.00">User</text>
<polyline fill="none" stroke="black" points="173.5,-88.5 358.5,-88.5 "/>
<text text-anchor="start" x="181" y="-75.5" font-family="Arial" font-size="10.00">email </text>
<text text-anchor="start" x="208" y="-75.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string U</text>
<text text-anchor="start" x="181" y="-62.5" font-family="Arial" font-size="10.00">encrypted_password </text>
<text text-anchor="start" x="275" y="-62.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="181" y="-49.5" font-family="Arial" font-size="10.00">name </text>
<text text-anchor="start" x="209" y="-49.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="181" y="-36.5" font-family="Arial" font-size="10.00">remember_created_at </text>
<text text-anchor="start" x="279" y="-36.5" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime (6,0)</text>
<text text-anchor="start" x="181" y="-23.5" font-family="Arial" font-size="10.00">reset_password_sent_at </text>
<text text-anchor="start" x="291" y="-23.5" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime (6,0)</text>
<text text-anchor="start" x="181" y="-10.5" font-family="Arial" font-size="10.00">reset_password_token </text>
<text text-anchor="start" x="283" y="-10.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<path fill="none" stroke="black" d="M734.5,-243C734.5,-243 895.5,-243 895.5,-243 901.5,-243 907.5,-249 907.5,-255 907.5,-255 907.5,-339 907.5,-339 907.5,-345 901.5,-351 895.5,-351 895.5,-351 734.5,-351 734.5,-351 728.5,-351 722.5,-345 722.5,-339 722.5,-339 722.5,-255 722.5,-255 722.5,-249 728.5,-243 734.5,-243"/>
<text text-anchor="start" x="800.5" y="-338.2" font-family="Arial Bold" font-size="11.00">User</text>
<polyline fill="none" stroke="black" points="722.5,-331 907.5,-331 "/>
<text text-anchor="start" x="730" y="-318" font-family="Arial" font-size="10.00">email </text>
<text text-anchor="start" x="757" y="-318" font-family="Arial Italic" font-size="10.00" fill="#999999">string U</text>
<text text-anchor="start" x="730" y="-305" font-family="Arial" font-size="10.00">encrypted_password </text>
<text text-anchor="start" x="824" y="-305" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="730" y="-292" font-family="Arial" font-size="10.00">name </text>
<text text-anchor="start" x="758" y="-292" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="730" y="-279" font-family="Arial" font-size="10.00">remember_created_at </text>
<text text-anchor="start" x="828" y="-279" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime (6,0)</text>
<text text-anchor="start" x="730" y="-266" font-family="Arial" font-size="10.00">reset_password_sent_at </text>
<text text-anchor="start" x="840" y="-266" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime (6,0)</text>
<text text-anchor="start" x="730" y="-253" font-family="Arial" font-size="10.00">reset_password_token </text>
<text text-anchor="start" x="832" y="-253" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
</g>
<!-- m_User&#45;&gt;m_Question -->
<g id="edge7" class="edge">
<title>m_User&#45;&gt;m_Question</title>
<path fill="none" stroke="black" d="M788.62,-242.97C783.2,-232.07 777.3,-220.22 771.31,-208.17"/>
<polygon fill="black" stroke="black" points="773.98,-206.46 767.15,-199.81 768.34,-209.27 773.98,-206.46"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 17 KiB