Remove PriceVersion

#475
This commit is contained in:
Artur Beljajev 2017-06-04 21:39:45 +03:00
parent 13d6799780
commit 5425a9ed7f
6 changed files with 7 additions and 103 deletions

View file

@ -1,7 +1,6 @@
module Billing module Billing
class Price < ActiveRecord::Base class Price < ActiveRecord::Base
include Versions include Versions
has_paper_trail class_name: '::PriceVersion'
self.auto_html5_validation = false self.auto_html5_validation = false

View file

@ -1,4 +0,0 @@
class PriceVersion < PaperTrail::Version
self.table_name = :log_pricelists
self.sequence_name = :log_pricelists_id_seq
end

View file

@ -0,0 +1,5 @@
class RemoveLogPricelists < ActiveRecord::Migration
def change
drop_table :log_pricelists
end
end

View file

@ -2147,43 +2147,6 @@ CREATE SEQUENCE log_nameservers_id_seq
ALTER SEQUENCE log_nameservers_id_seq OWNED BY log_nameservers.id; ALTER SEQUENCE log_nameservers_id_seq OWNED BY log_nameservers.id;
--
-- Name: log_pricelists; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE log_pricelists (
id integer NOT NULL,
item_type character varying NOT NULL,
item_id integer NOT NULL,
event character varying NOT NULL,
whodunnit character varying,
object json,
object_changes json,
created_at timestamp without time zone,
session character varying,
uuid character varying
);
--
-- Name: log_pricelists_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE log_pricelists_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: log_pricelists_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE log_pricelists_id_seq OWNED BY log_pricelists.id;
-- --
-- Name: log_registrars; Type: TABLE; Schema: public; Owner: -; Tablespace: -- Name: log_registrars; Type: TABLE; Schema: public; Owner: -; Tablespace:
-- --
@ -3299,13 +3262,6 @@ ALTER TABLE ONLY log_messages ALTER COLUMN id SET DEFAULT nextval('log_messages_
ALTER TABLE ONLY log_nameservers ALTER COLUMN id SET DEFAULT nextval('log_nameservers_id_seq'::regclass); ALTER TABLE ONLY log_nameservers ALTER COLUMN id SET DEFAULT nextval('log_nameservers_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY log_pricelists ALTER COLUMN id SET DEFAULT nextval('log_pricelists_id_seq'::regclass);
-- --
-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- Name: id; Type: DEFAULT; Schema: public; Owner: -
-- --
@ -3822,14 +3778,6 @@ ALTER TABLE ONLY log_nameservers
ADD CONSTRAINT log_nameservers_pkey PRIMARY KEY (id); ADD CONSTRAINT log_nameservers_pkey PRIMARY KEY (id);
--
-- Name: log_pricelists_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY log_pricelists
ADD CONSTRAINT log_pricelists_pkey PRIMARY KEY (id);
-- --
-- Name: log_registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- Name: log_registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
-- --
@ -5308,3 +5256,5 @@ INSERT INTO schema_migrations (version) VALUES ('20170506205946');
INSERT INTO schema_migrations (version) VALUES ('20170506212014'); INSERT INTO schema_migrations (version) VALUES ('20170506212014');
INSERT INTO schema_migrations (version) VALUES ('20170604182521');

View file

@ -166,17 +166,6 @@
<ellipse fill="none" stroke="#e88904" cx="349.694" cy="-125.352" rx="4.00002" ry="4.00002"/> <ellipse fill="none" stroke="#e88904" cx="349.694" cy="-125.352" rx="4.00002" ry="4.00002"/>
<polygon fill="#e88904" stroke="#e88904" points="1479.91,-20.9262 1490.02,-25.1909 1484.91,-20.8092 1489.91,-20.6922 1489.91,-20.6922 1489.91,-20.6922 1484.91,-20.8092 1489.8,-16.1934 1479.91,-20.9262 1479.91,-20.9262"/> <polygon fill="#e88904" stroke="#e88904" points="1479.91,-20.9262 1490.02,-25.1909 1484.91,-20.8092 1489.91,-20.6922 1489.91,-20.6922 1489.91,-20.6922 1484.91,-20.8092 1489.8,-16.1934 1479.91,-20.9262 1479.91,-20.9262"/>
</g> </g>
<!-- PricelistVersion -->
<g id="node15" class="node"><title>PricelistVersion</title>
<ellipse fill="none" stroke="black" cx="2888.99" cy="-91" rx="67.6881" ry="18"/>
<text text-anchor="middle" x="2888.99" y="-87.3" font-family="Times,serif" font-size="14.00">PricelistVersion</text>
</g>
<!-- PricelistVersion&#45;&gt;VersionAssociation -->
<g id="edge13" class="edge"><title>PricelistVersion&#45;&gt;VersionAssociation</title>
<path fill="none" stroke="#66b357" d="M2833.71,-76.4421C2826.77,-75.0923 2819.74,-73.8934 2812.99,-73 2589.58,-43.3999 1904.87,-26.195 1658.49,-20.8299"/>
<ellipse fill="none" stroke="#66b357" cx="2837.87" cy="-77.2894" rx="4.00001" ry="4.00001"/>
<polygon fill="#66b357" stroke="#66b357" points="1658.15,-20.8225 1648.25,-16.1071 1653.15,-20.7143 1648.15,-20.606 1648.15,-20.606 1648.15,-20.606 1653.15,-20.7143 1648.05,-25.105 1658.15,-20.8225 1658.15,-20.8225"/>
</g>
<!-- MessageVersion --> <!-- MessageVersion -->
<g id="node16" class="node"><title>MessageVersion</title> <g id="node16" class="node"><title>MessageVersion</title>
<ellipse fill="none" stroke="black" cx="1093.99" cy="-253" rx="69.5877" ry="18"/> <ellipse fill="none" stroke="black" cx="1093.99" cy="-253" rx="69.5877" ry="18"/>
@ -1240,13 +1229,6 @@
<ellipse fill="none" stroke="black" cx="4191.99" cy="-523" rx="51.9908" ry="18"/> <ellipse fill="none" stroke="black" cx="4191.99" cy="-523" rx="51.9908" ry="18"/>
<text text-anchor="middle" x="4191.99" y="-519.3" font-family="Times,serif" font-size="14.00">EppSession</text> <text text-anchor="middle" x="4191.99" y="-519.3" font-family="Times,serif" font-size="14.00">EppSession</text>
</g> </g>
<!-- Pricelist&#45;&gt;PricelistVersion -->
<g id="edge79" class="edge"><title>Pricelist&#45;&gt;PricelistVersion</title>
<path fill="none" stroke="#499b9a" d="M3250.87,-173.392C3244.19,-157.303 3233,-137.406 3215.99,-127 3168.48,-97.9313 3021.11,-117.025 2965.99,-109 2959.86,-108.107 2953.49,-106.998 2947.15,-105.777"/>
<ellipse fill="none" stroke="#499b9a" cx="3252.35" cy="-177.198" rx="4.00001" ry="4.00001"/>
<polygon fill="#499b9a" stroke="#499b9a" points="2947.07,-105.76 2938.16,-99.371 2942.17,-104.771 2937.27,-103.782 2937.27,-103.782 2937.27,-103.782 2942.17,-104.771 2936.37,-108.193 2947.07,-105.76 2947.07,-105.76"/>
<text text-anchor="middle" x="3267.99" y="-141.3" font-family="Times,serif" font-size="14.00">versions</text>
</g>
<!-- InvoiceItem --> <!-- InvoiceItem -->
<g id="node55" class="node"><title>InvoiceItem</title> <g id="node55" class="node"><title>InvoiceItem</title>
<ellipse fill="none" stroke="black" cx="201.994" cy="-199" rx="53.8905" ry="18"/> <ellipse fill="none" stroke="black" cx="201.994" cy="-199" rx="53.8905" ry="18"/>

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 132 KiB

Before After
Before After

View file

@ -330,27 +330,6 @@
<ellipse fill="none" stroke="#3eeac6" cx="420.555" cy="-269.403" rx="4.00001" ry="4.00001"/> <ellipse fill="none" stroke="#3eeac6" cx="420.555" cy="-269.403" rx="4.00001" ry="4.00001"/>
<polygon fill="#3eeac6" stroke="#3eeac6" points="1667.41,-20.0428 1677.47,-24.4139 1672.41,-19.9786 1677.41,-19.9143 1677.41,-19.9143 1677.41,-19.9143 1672.41,-19.9786 1677.35,-15.4146 1667.41,-20.0428 1667.41,-20.0428"/> <polygon fill="#3eeac6" stroke="#3eeac6" points="1667.41,-20.0428 1677.47,-24.4139 1672.41,-19.9786 1677.41,-19.9143 1677.41,-19.9143 1677.41,-19.9143 1672.41,-19.9786 1677.35,-15.4146 1667.41,-20.0428 1667.41,-20.0428"/>
</g> </g>
<!-- PricelistVersion -->
<g id="node15" class="node"><title>PricelistVersion</title>
<path fill="none" stroke="black" d="M2986,-81C2986,-81 3092,-81 3092,-81 3098,-81 3104,-87 3104,-93 3104,-93 3104,-235 3104,-235 3104,-241 3098,-247 3092,-247 3092,-247 2986,-247 2986,-247 2980,-247 2974,-241 2974,-235 2974,-235 2974,-93 2974,-93 2974,-87 2980,-81 2986,-81"/>
<text text-anchor="middle" x="3039" y="-231.8" font-family="Times,serif" font-size="14.00">PricelistVersion</text>
<polyline fill="none" stroke="black" points="2974,-224 3104,-224 "/>
<text text-anchor="start" x="2982" y="-208.8" font-family="Times,serif" font-size="14.00">id :integer</text>
<text text-anchor="start" x="2982" y="-193.8" font-family="Times,serif" font-size="14.00">item_type :string</text>
<text text-anchor="start" x="2982" y="-178.8" font-family="Times,serif" font-size="14.00">item_id :integer</text>
<text text-anchor="start" x="2982" y="-163.8" font-family="Times,serif" font-size="14.00">event :string</text>
<text text-anchor="start" x="2982" y="-148.8" font-family="Times,serif" font-size="14.00">whodunnit :string</text>
<text text-anchor="start" x="2982" y="-133.8" font-family="Times,serif" font-size="14.00">object :json</text>
<text text-anchor="start" x="2982" y="-118.8" font-family="Times,serif" font-size="14.00">object_changes :json</text>
<text text-anchor="start" x="2982" y="-103.8" font-family="Times,serif" font-size="14.00">created_at :datetime</text>
<text text-anchor="start" x="2982" y="-88.8" font-family="Times,serif" font-size="14.00">session :string</text>
</g>
<!-- PricelistVersion&#45;&gt;VersionAssociation -->
<g id="edge13" class="edge"><title>PricelistVersion&#45;&gt;VersionAssociation</title>
<path fill="none" stroke="#219849" d="M2970.55,-76.1769C2968.73,-75.0528 2966.88,-73.9914 2965,-73 2880.55,-28.4331 2846.3,-59.9044 2751,-54 2417.69,-33.35 2020.69,-23.9253 1846.46,-20.5507"/>
<ellipse fill="none" stroke="#219849" cx="2974.09" cy="-78.5702" rx="4.00002" ry="4.00002"/>
<polygon fill="#219849" stroke="#219849" points="1846.31,-20.548 1836.4,-15.8571 1841.31,-20.4521 1836.31,-20.3562 1836.31,-20.3562 1836.31,-20.3562 1841.31,-20.4521 1836.23,-24.8554 1846.31,-20.548 1846.31,-20.548"/>
</g>
<!-- MessageVersion --> <!-- MessageVersion -->
<g id="node16" class="node"><title>MessageVersion</title> <g id="node16" class="node"><title>MessageVersion</title>
<path fill="none" stroke="black" d="M1120,-733.5C1120,-733.5 1226,-733.5 1226,-733.5 1232,-733.5 1238,-739.5 1238,-745.5 1238,-745.5 1238,-902.5 1238,-902.5 1238,-908.5 1232,-914.5 1226,-914.5 1226,-914.5 1120,-914.5 1120,-914.5 1114,-914.5 1108,-908.5 1108,-902.5 1108,-902.5 1108,-745.5 1108,-745.5 1108,-739.5 1114,-733.5 1120,-733.5"/> <path fill="none" stroke="black" d="M1120,-733.5C1120,-733.5 1226,-733.5 1226,-733.5 1232,-733.5 1238,-739.5 1238,-745.5 1238,-745.5 1238,-902.5 1238,-902.5 1238,-908.5 1232,-914.5 1226,-914.5 1226,-914.5 1120,-914.5 1120,-914.5 1114,-914.5 1108,-908.5 1108,-902.5 1108,-902.5 1108,-745.5 1108,-745.5 1108,-739.5 1114,-733.5 1120,-733.5"/>
@ -1998,13 +1977,6 @@
<text text-anchor="start" x="4306.5" y="-2451.8" font-family="Times,serif" font-size="14.00">updated_at :datetime</text> <text text-anchor="start" x="4306.5" y="-2451.8" font-family="Times,serif" font-size="14.00">updated_at :datetime</text>
<text text-anchor="start" x="4306.5" y="-2436.8" font-family="Times,serif" font-size="14.00">registrar_id :integer</text> <text text-anchor="start" x="4306.5" y="-2436.8" font-family="Times,serif" font-size="14.00">registrar_id :integer</text>
</g> </g>
<!-- Pricelist&#45;&gt;PricelistVersion -->
<g id="edge79" class="edge"><title>Pricelist&#45;&gt;PricelistVersion</title>
<path fill="none" stroke="#7416af" d="M3665.06,-472.647C3650.73,-402.404 3620.54,-318.837 3557,-273 3516.96,-244.115 3157.21,-276.99 3113,-255 3111.44,-254.226 3109.91,-253.402 3108.39,-252.533"/>
<ellipse fill="none" stroke="#7416af" cx="3665.88" cy="-476.781" rx="4.00001" ry="4.00001"/>
<polygon fill="#7416af" stroke="#7416af" points="3108.36,-252.513 3102.4,-243.31 3104.16,-249.802 3099.96,-247.091 3099.96,-247.091 3099.96,-247.091 3104.16,-249.802 3097.52,-250.872 3108.36,-252.513 3108.36,-252.513"/>
<text text-anchor="middle" x="3682" y="-360.3" font-family="Times,serif" font-size="14.00">versions</text>
</g>
<!-- InvoiceItem --> <!-- InvoiceItem -->
<g id="node55" class="node"><title>InvoiceItem</title> <g id="node55" class="node"><title>InvoiceItem</title>
<path fill="none" stroke="black" d="M160.5,-503.5C160.5,-503.5 267.5,-503.5 267.5,-503.5 273.5,-503.5 279.5,-509.5 279.5,-515.5 279.5,-515.5 279.5,-672.5 279.5,-672.5 279.5,-678.5 273.5,-684.5 267.5,-684.5 267.5,-684.5 160.5,-684.5 160.5,-684.5 154.5,-684.5 148.5,-678.5 148.5,-672.5 148.5,-672.5 148.5,-515.5 148.5,-515.5 148.5,-509.5 154.5,-503.5 160.5,-503.5"/> <path fill="none" stroke="black" d="M160.5,-503.5C160.5,-503.5 267.5,-503.5 267.5,-503.5 273.5,-503.5 279.5,-509.5 279.5,-515.5 279.5,-515.5 279.5,-672.5 279.5,-672.5 279.5,-678.5 273.5,-684.5 267.5,-684.5 267.5,-684.5 160.5,-684.5 160.5,-684.5 154.5,-684.5 148.5,-678.5 148.5,-672.5 148.5,-672.5 148.5,-515.5 148.5,-515.5 148.5,-509.5 154.5,-503.5 160.5,-503.5"/>

Before

Width:  |  Height:  |  Size: 244 KiB

After

Width:  |  Height:  |  Size: 241 KiB

Before After
Before After