localtower 0.4.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +37 -46
  3. data/app/controllers/localtower/pages_controller.rb +28 -42
  4. data/app/helpers/localtower/application_helper.rb +0 -18
  5. data/app/views/layouts/localtower/application.html.erb +20 -79
  6. data/app/views/localtower/pages/_alert_no_models.html.erb +3 -0
  7. data/app/views/localtower/pages/migrations.html.erb +50 -120
  8. data/app/views/localtower/pages/models.html.erb +53 -68
  9. data/app/views/localtower/pages/new_migration.html.erb +103 -0
  10. data/app/views/localtower/pages/new_model.html.erb +87 -0
  11. data/config/routes.rb +8 -17
  12. data/lib/localtower/generators/migration.rb +53 -181
  13. data/lib/localtower/generators/model.rb +53 -32
  14. data/lib/localtower/generators/service_objects/insert_array.rb +23 -0
  15. data/lib/localtower/generators/service_objects/insert_defaults.rb +15 -43
  16. data/lib/localtower/generators/service_objects/insert_indexes.rb +80 -0
  17. data/lib/localtower/generators/service_objects/insert_nullable.rb +23 -0
  18. data/lib/localtower/status.rb +12 -7
  19. data/lib/localtower/tools.rb +29 -24
  20. data/lib/localtower/version.rb +1 -1
  21. data/lib/localtower.rb +0 -1
  22. data/public/css/app.css +0 -49
  23. data/public/js/app.js +216 -86
  24. data/public/light-bootstrap-dashboard-master/assets/css/light-bootstrap-dashboard.css +9 -35
  25. data/public/screenshots/v1.0.0/migrations.png +0 -0
  26. data/public/screenshots/v1.0.0/models.png +0 -0
  27. data/public/screenshots/v1.0.0/new_migration.png +0 -0
  28. data/public/screenshots/v1.0.0/new_model.png +0 -0
  29. data/public/vendor/font-awesome.min.css +4 -0
  30. data/public/vendor/highlight-js-default.min.css +9 -0
  31. data/public/vendor/highlight.min.js +1198 -0
  32. data/public/{js → vendor}/masonry.pkgd.min.js +0 -0
  33. data/spec/dummy/Gemfile +0 -3
  34. data/spec/dummy/Gemfile.lock +78 -95
  35. data/spec/dummy/app/controllers/pages_controller.rb +0 -2
  36. data/spec/dummy/app/models/post.rb +3 -0
  37. data/spec/dummy/app/models/user.rb +3 -0
  38. data/spec/dummy/app/views/pages/home.html.erb +0 -1
  39. data/spec/dummy/config/database.yml +1 -1
  40. data/spec/dummy/config/environments/development.rb +3 -1
  41. data/spec/dummy/config/puma.rb +1 -1
  42. data/spec/dummy/db/migrate/20230119221452_create_users.rb +14 -0
  43. data/spec/dummy/db/migrate/20230119221751_change_users_at1674166670.rb +7 -0
  44. data/spec/dummy/db/migrate/20230119222054_create_posts.rb +11 -0
  45. data/spec/dummy/db/migrate/20230119222106_change_posts_at1674166865.rb +5 -0
  46. data/spec/dummy/db/schema.rb +41 -0
  47. data/spec/dummy/log/development.log +16030 -10038
  48. data/spec/dummy/log/localtower.log +1878 -439
  49. data/spec/dummy/log/test.log +0 -281
  50. data/spec/dummy/test/index.html +38 -0
  51. data/spec/dummy/tmp/pids/server.pid +1 -1
  52. data/spec/factories/migration.rb +25 -41
  53. data/spec/factories/model.rb +39 -25
  54. data/spec/lib/localtower/generators/migration_spec.rb +36 -63
  55. data/spec/lib/localtower/generators/model_spec.rb +43 -34
  56. data/spec/lib/localtower/generators/service_objects/insert_array_spec.rb +47 -0
  57. data/spec/lib/localtower/generators/service_objects/insert_defaults_spec.rb +30 -35
  58. data/spec/lib/localtower/generators/service_objects/insert_indexes_spec.rb +90 -0
  59. data/spec/lib/localtower/generators/service_objects/insert_nullable_spec.rb +61 -0
  60. data/spec/lib/localtower/tools_spec.rb +1 -11
  61. data/spec/spec_helper.rb +25 -5
  62. metadata +38 -30
  63. data/app/views/localtower/pages/dashboard.html.erb +0 -67
  64. data/app/views/localtower/pages/logs.html.erb +0 -84
  65. data/app/views/localtower/pages/relations.html.erb +0 -66
  66. data/app/views/localtower/pages/tasks.html.erb +0 -48
  67. data/lib/localtower/generators/relation.rb +0 -59
  68. data/lib/localtower/plugins/capture.rb +0 -197
  69. data/lib/tasks/localtower_tasks.rake +0 -4
  70. data/spec/dummy/lib/playground.rb +0 -0
  71. data/spec/dummy/log/localtower_capture_d8979d360722798f7b6eb1a2694a3791.json +0 -1
  72. data/spec/lib/localtower/generators/relation_spec.rb +0 -65
@@ -1,281 +0,0 @@
1
-  (7.8ms) DROP TABLE if exists DAMS cascade;
2
-  (2.3ms) DROP TABLE if exists SCHEMA_MIGRATIONS cascade;
3
-  (1.6ms) DROP TABLE if exists AR_INTERNAL_METADATA cascade;
4
-  (1.6ms) DROP TABLE if exists TESTS cascade;
5
-  (2.5ms) DROP TABLE if exists POSTS cascade;
6
-  (2.1ms) DROP TABLE if exists DAMIANS cascade;
7
-  (15.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
8
-  (6.9ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
9
-  (0.3ms) SELECT pg_try_advisory_lock(268089350951355045)
10
-  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
11
- Migrating to ChangeTheModelPostAtTime1644360105 (20220208224147)
12
-  (0.2ms) BEGIN
13
-  (5.7ms) CREATE TABLE "posts" ("id" bigserial primary key)
14
- ActiveRecord::SchemaMigration Create (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224147"]]
15
-  (0.5ms) COMMIT
16
- ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
17
-  (0.1ms) BEGIN
18
- ActiveRecord::InternalMetadata Create (1.7ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", "2022-02-08 22:41:48.328889"], ["updated_at", "2022-02-08 22:41:48.328889"]]
19
-  (0.2ms) COMMIT
20
-  (0.3ms) SELECT pg_advisory_unlock(268089350951355045)
21
-  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
22
-  (0.7ms) SELECT pg_try_advisory_lock(268089350951355045)
23
-  (2.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
24
- Migrating to ChangeTheModelUserAtTime1644360108 (20220208224149)
25
-  (0.2ms) BEGIN
26
-  (10.8ms) CREATE TABLE "users" ("id" bigserial primary key)
27
- ActiveRecord::SchemaMigration Create (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224149"]]
28
-  (1.0ms) COMMIT
29
- ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
30
-  (0.3ms) BEGIN
31
-  (0.2ms) COMMIT
32
-  (0.4ms) SELECT pg_advisory_unlock(268089350951355045)
33
-  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
34
-  (0.5ms) SELECT pg_try_advisory_lock(268089350951355045)
35
-  (2.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
36
- Migrating to ChangeTheModelPostAtTime1644360110 (20220208224152)
37
-  (0.2ms) BEGIN
38
-  (9.0ms) ALTER TABLE "posts" ADD "tags" text[] DEFAULT '{}'
39
-  (1.9ms) CREATE INDEX "index_posts_on_tags" ON "posts" USING gin ("tags")
40
-  (0.4ms) ALTER TABLE "posts" ADD "views" integer DEFAULT 0 NOT NULL
41
-  (0.2ms) ALTER TABLE "posts" ADD "content" text
42
-  (0.3ms) ALTER TABLE "posts" ADD "title" character varying
43
- ActiveRecord::SchemaMigration Create (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224152"]]
44
-  (0.5ms) COMMIT
45
- ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
46
-  (0.1ms) BEGIN
47
-  (0.1ms) COMMIT
48
-  (0.3ms) SELECT pg_advisory_unlock(268089350951355045)
49
-  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
50
-  (0.3ms) SELECT pg_try_advisory_lock(268089350951355045)
51
-  (2.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
52
- Migrating to ChangeTheModelPostAtTime1644360113 (20220208224154)
53
-  (0.2ms) BEGIN
54
- ActiveRecord::SchemaMigration Create (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224154"]]
55
-  (0.9ms) COMMIT
56
- ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
57
-  (0.3ms) BEGIN
58
-  (0.1ms) COMMIT
59
-  (0.5ms) SELECT pg_advisory_unlock(268089350951355045)
60
-  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
61
-  (0.3ms) SELECT pg_try_advisory_lock(268089350951355045)
62
-  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
63
- Migrating to ChangeTheModelPostAtTime1644360115 (20220208224157)
64
-  (0.2ms) BEGIN
65
-  (1.4ms) ALTER TABLE "posts" RENAME COLUMN "content" TO "content_new"
66
- ActiveRecord::SchemaMigration Create (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224157"]]
67
-  (0.5ms) COMMIT
68
- ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
69
-  (0.2ms) BEGIN
70
-  (0.2ms) COMMIT
71
-  (0.3ms) SELECT pg_advisory_unlock(268089350951355045)
72
-  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
73
-  (0.5ms) SELECT pg_try_advisory_lock(268089350951355045)
74
-  (2.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
75
- Migrating to ChangeTheModelPostAtTime1644360118 (20220208224159)
76
-  (0.2ms) BEGIN
77
-  (1.0ms) ALTER TABLE "posts" RENAME COLUMN "views" TO "views_by_users"
78
-  (3.0ms) ALTER TABLE "posts" DROP COLUMN "title"
79
- ActiveRecord::SchemaMigration Create (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224159"]]
80
-  (0.7ms) COMMIT
81
- ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
82
-  (0.3ms) BEGIN
83
-  (0.3ms) COMMIT
84
-  (0.5ms) SELECT pg_advisory_unlock(268089350951355045)
85
-  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
86
-  (0.3ms) SELECT pg_try_advisory_lock(268089350951355045)
87
-  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
88
- Migrating to ChangeTheModelPostAtTime1644360120 (20220208224202)
89
-  (0.1ms) BEGIN
90
-  (3.4ms) CREATE INDEX "index_posts_on_views_by_users" ON "posts" ("views_by_users")
91
-  (1.3ms) ALTER TABLE "posts" ALTER COLUMN "content_new" TYPE character varying
92
- ActiveRecord::SchemaMigration Create (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224202"]]
93
-  (0.8ms) COMMIT
94
- ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
95
-  (0.2ms) BEGIN
96
-  (0.2ms) COMMIT
97
-  (0.3ms) SELECT pg_advisory_unlock(268089350951355045)
98
-  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
99
-  (0.5ms) SELECT pg_try_advisory_lock(268089350951355045)
100
-  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
101
- Migrating to ChangeTheModelPostAtTime1644360123 (20220208224204)
102
-  (0.2ms) BEGIN
103
-  (3.9ms) CREATE INDEX "index_posts_on_content_new" ON "posts" ("content_new")
104
- ActiveRecord::SchemaMigration Create (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224204"]]
105
-  (0.7ms) COMMIT
106
- ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
107
-  (0.1ms) BEGIN
108
-  (0.2ms) COMMIT
109
-  (0.3ms) SELECT pg_advisory_unlock(268089350951355045)
110
-  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
111
-  (0.5ms) SELECT pg_try_advisory_lock(268089350951355045)
112
-  (2.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
113
- Migrating to ChangeTheModelPostAtTime1644360125 (20220208224207)
114
-  (0.2ms) BEGIN
115
-  (1.8ms) DROP INDEX "index_posts_on_views_by_users"
116
- ActiveRecord::SchemaMigration Create (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224207"]]
117
-  (2.1ms) COMMIT
118
- ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
119
-  (0.2ms) BEGIN
120
-  (0.1ms) COMMIT
121
-  (0.3ms) SELECT pg_advisory_unlock(268089350951355045)
122
-  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
123
-  (0.6ms) SELECT pg_try_advisory_lock(268089350951355045)
124
-  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
125
- Migrating to ChangeTheModelPostAtTime1644360128 (20220208224209)
126
-  (0.2ms) BEGIN
127
-  (7.2ms) DROP TABLE "posts" CASCADE
128
- ActiveRecord::SchemaMigration Create (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224209"]]
129
-  (3.7ms) COMMIT
130
- ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
131
-  (0.2ms) BEGIN
132
-  (0.2ms) COMMIT
133
-  (0.5ms) SELECT pg_advisory_unlock(268089350951355045)
134
-  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
135
-  (3.1ms) DROP TABLE if exists SCHEMA_MIGRATIONS cascade;
136
-  (3.6ms) DROP TABLE if exists AR_INTERNAL_METADATA cascade;
137
-  (3.1ms) DROP TABLE if exists USERS cascade;
138
-  (12.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
139
-  (5.9ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
140
-  (0.2ms) SELECT pg_try_advisory_lock(268089350951355045)
141
-  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
142
- Migrating to CreatePosts (20220208224212)
143
-  (0.2ms) BEGIN
144
-  (8.5ms) CREATE TABLE "posts" ("id" bigserial primary key, "title" character varying, "content" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
145
-  (0.7ms) CREATE INDEX "index_posts_on_title" ON "posts" ("title")
146
- ActiveRecord::SchemaMigration Create (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224212"]]
147
-  (0.6ms) COMMIT
148
- ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
149
-  (0.2ms) BEGIN
150
- ActiveRecord::InternalMetadata Create (0.7ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", "2022-02-08 22:42:13.396376"], ["updated_at", "2022-02-08 22:42:13.396376"]]
151
-  (0.4ms) COMMIT
152
-  (0.3ms) SELECT pg_advisory_unlock(268089350951355045)
153
-  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
154
-  (0.5ms) SELECT pg_try_advisory_lock(268089350951355045)
155
-  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
156
- Migrating to CreateUsers (20220208224214)
157
-  (0.4ms) BEGIN
158
-  (12.6ms) CREATE TABLE "users" ("id" bigserial primary key, "name" character varying, "metadata" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
159
-  (1.7ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
160
- ActiveRecord::SchemaMigration Create (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224214"]]
161
-  (0.5ms) COMMIT
162
- ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
163
-  (0.1ms) BEGIN
164
-  (0.1ms) COMMIT
165
-  (0.3ms) SELECT pg_advisory_unlock(268089350951355045)
166
-  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
167
-  (4.0ms) DROP TABLE if exists SCHEMA_MIGRATIONS cascade;
168
-  (3.2ms) DROP TABLE if exists AR_INTERNAL_METADATA cascade;
169
-  (4.3ms) DROP TABLE if exists POSTS cascade;
170
-  (3.9ms) DROP TABLE if exists USERS cascade;
171
-  (14.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
172
-  (3.7ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
173
-  (0.2ms) SELECT pg_try_advisory_lock(268089350951355045)
174
-  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
175
- Migrating to CreatePosts (20220208224217)
176
-  (0.3ms) BEGIN
177
-  (3.6ms) CREATE TABLE "posts" ("id" bigserial primary key, "title" character varying, "content" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
178
-  (1.0ms) CREATE INDEX "index_posts_on_title" ON "posts" ("title")
179
- ActiveRecord::SchemaMigration Create (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224217"]]
180
-  (0.4ms) COMMIT
181
- ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
182
-  (0.2ms) BEGIN
183
- ActiveRecord::InternalMetadata Create (0.7ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", "2022-02-08 22:42:18.353630"], ["updated_at", "2022-02-08 22:42:18.353630"]]
184
-  (0.3ms) COMMIT
185
-  (0.2ms) SELECT pg_advisory_unlock(268089350951355045)
186
-  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
187
-  (0.5ms) SELECT pg_try_advisory_lock(268089350951355045)
188
-  (2.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
189
- Migrating to CreateUsers (20220208224219)
190
-  (0.2ms) BEGIN
191
-  (59.7ms) CREATE TABLE "users" ("id" bigserial primary key, "name" character varying, "metadata" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
192
-  (2.9ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
193
- ActiveRecord::SchemaMigration Create (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224219"]]
194
-  (1.1ms) COMMIT
195
- ActiveRecord::InternalMetadata Load (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
196
-  (0.2ms) BEGIN
197
-  (0.2ms) COMMIT
198
-  (0.6ms) SELECT pg_advisory_unlock(268089350951355045)
199
-  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
200
-  (0.5ms) SELECT pg_try_advisory_lock(268089350951355045)
201
-  (2.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
202
- Migrating to ChangeTheModelPostAtTime1644360141 (20220208224222)
203
-  (0.2ms) BEGIN
204
-  (2.1ms) ALTER TABLE "posts" ADD "user_id" bigint
205
-  (3.6ms) CREATE INDEX "index_posts_on_user_id" ON "posts" ("user_id")
206
-  (9.5ms) ALTER TABLE "posts" ADD CONSTRAINT "fk_rails_5b5ddfd518"
207
- FOREIGN KEY ("user_id")
208
- REFERENCES "users" ("id")
209
- 
210
- ActiveRecord::SchemaMigration Create (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224222"]]
211
-  (0.7ms) COMMIT
212
- ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
213
-  (0.1ms) BEGIN
214
-  (0.2ms) COMMIT
215
-  (0.3ms) SELECT pg_advisory_unlock(268089350951355045)
216
-  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
217
-  (6.7ms) DROP TABLE if exists USERS cascade;
218
-  (3.3ms) DROP TABLE if exists SCHEMA_MIGRATIONS cascade;
219
-  (1.9ms) DROP TABLE if exists AR_INTERNAL_METADATA cascade;
220
-  (2.9ms) DROP TABLE if exists POSTS cascade;
221
-  (14.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
222
-  (6.1ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
223
-  (0.3ms) SELECT pg_try_advisory_lock(268089350951355045)
224
-  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
225
- Migrating to CreatePosts (20220208224224)
226
-  (0.2ms) BEGIN
227
-  (9.0ms) CREATE TABLE "posts" ("id" bigserial primary key, "title" character varying, "content" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
228
-  (0.7ms) CREATE INDEX "index_posts_on_title" ON "posts" ("title")
229
- ActiveRecord::SchemaMigration Create (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224224"]]
230
-  (0.4ms) COMMIT
231
- Migrating to CreateUsers (20220208224225)
232
-  (0.3ms) BEGIN
233
-  (3.2ms) CREATE TABLE "users" ("id" bigserial primary key, "name" character varying, "metadata" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
234
-  (0.7ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
235
- ActiveRecord::SchemaMigration Create (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224225"]]
236
-  (0.5ms) COMMIT
237
- Migrating to CreateUserPosts (20220208224227)
238
-  (0.2ms) BEGIN
239
-  (3.6ms) CREATE TABLE "user_posts" ("id" bigserial primary key, "user_id" bigint, "post_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, CONSTRAINT "fk_rails_6c6a346128"
240
- FOREIGN KEY ("user_id")
241
- REFERENCES "users" ("id")
242
- , CONSTRAINT "fk_rails_38a7c4b06f"
243
- FOREIGN KEY ("post_id")
244
- REFERENCES "posts" ("id")
245
- )
246
-  (0.6ms) CREATE INDEX "index_user_posts_on_user_id" ON "user_posts" ("user_id")
247
-  (0.8ms) CREATE INDEX "index_user_posts_on_post_id" ON "user_posts" ("post_id")
248
- ActiveRecord::SchemaMigration Create (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20220208224227"]]
249
-  (0.5ms) COMMIT
250
- ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
251
-  (0.1ms) BEGIN
252
- ActiveRecord::InternalMetadata Create (0.5ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", "2022-02-08 22:42:28.406529"], ["updated_at", "2022-02-08 22:42:28.406529"]]
253
-  (0.6ms) COMMIT
254
-  (0.5ms) SELECT pg_advisory_unlock(268089350951355045)
255
-  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
256
-  (4.1ms) DROP TABLE if exists SCHEMA_MIGRATIONS cascade;
257
-  (2.9ms) DROP TABLE if exists AR_INTERNAL_METADATA cascade;
258
-  (6.3ms) DROP TABLE if exists POSTS cascade;
259
-  (5.1ms) DROP TABLE if exists USERS cascade;
260
-  (1.9ms) DROP TABLE if exists USER_POSTS cascade;
261
-  (0.3ms) SELECT pg_try_advisory_lock(268089350951355045)
262
- ActiveRecord::SchemaMigration Pluck (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
263
- ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
264
- TRANSACTION (1.3ms) BEGIN
265
- ActiveRecord::InternalMetadata Update (1.7ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2022-04-23 20:12:23.735485"], ["key", "environment"]]
266
- TRANSACTION (1.0ms) COMMIT
267
-  (0.4ms) SELECT pg_advisory_unlock(268089350951355045)
268
- ActiveRecord::SchemaMigration Pluck (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
269
-  (0.2ms) SELECT pg_try_advisory_lock(268089350951355045)
270
- ActiveRecord::SchemaMigration Pluck (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
271
- ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
272
- TRANSACTION (0.1ms) BEGIN
273
- ActiveRecord::InternalMetadata Update (0.4ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2022-07-03 18:37:21.534024"], ["key", "environment"]]
274
- TRANSACTION (1.9ms) COMMIT
275
-  (0.4ms) SELECT pg_advisory_unlock(268089350951355045)
276
- ActiveRecord::SchemaMigration Pluck (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
277
-  (0.2ms) SELECT pg_try_advisory_lock(268089350951355045)
278
- ActiveRecord::SchemaMigration Pluck (1.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
279
- ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
280
-  (0.7ms) SELECT pg_advisory_unlock(268089350951355045)
281
- ActiveRecord::SchemaMigration Pluck (2.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
@@ -0,0 +1,38 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <script src="https://cdn.tailwindcss.com"></script>
7
+ <script>
8
+ tailwind.config = {
9
+ theme: {
10
+ extend: {
11
+ colors: {
12
+ clifford: '#da373d',
13
+ }
14
+ }
15
+ }
16
+ }
17
+ </script>
18
+ <style type="text/tailwindcss">
19
+ @layer utilities {
20
+ .content-auto {
21
+ content-visibility: auto;
22
+ }
23
+
24
+ .nude {
25
+ @apply text-green-500;
26
+
27
+ }
28
+ }
29
+ </style>
30
+ </head>
31
+ <body>
32
+ <div class="container mx-auto">
33
+ <h1 class="nude text-3xl font-bold underline">
34
+ Hello world!
35
+ </h1>
36
+ </div>
37
+ </body>
38
+ </html>
@@ -1 +1 @@
1
- 45798
1
+ 67242
@@ -1,28 +1,4 @@
1
1
  FactoryBot.define do
2
- factory :create_table, class: "Hash" do
3
- migration_name { "Post" }
4
- migrations do
5
- [
6
- {
7
- action: "create_table",
8
- table_name: "posts"
9
- }
10
- ]
11
- end
12
- end
13
-
14
- factory :create_table_two, class: "Hash" do
15
- migration_name { "User" }
16
- migrations do
17
- [
18
- {
19
- action: "create_table",
20
- table_name: "users"
21
- }
22
- ]
23
- end
24
- end
25
-
26
2
  factory :add_column, class: "Hash" do
27
3
  migration_name { "Post" }
28
4
  migrations do
@@ -32,7 +8,6 @@ FactoryBot.define do
32
8
  table_name: "posts",
33
9
  column: "title",
34
10
  column_type: "string",
35
- index: true,
36
11
  nullable: true,
37
12
  },
38
13
  {
@@ -40,7 +15,6 @@ FactoryBot.define do
40
15
  table_name: "posts",
41
16
  column: "content",
42
17
  column_type: "text",
43
- index: false,
44
18
  nullable: true,
45
19
  },
46
20
  {
@@ -64,20 +38,6 @@ FactoryBot.define do
64
38
  end
65
39
  end
66
40
 
67
- factory :add_column_fail, class: "Hash" do
68
- migration_name { "Post" }
69
- migrations do
70
- [
71
- {
72
- action: "add_column",
73
- table_name: "posts",
74
- column: "title",
75
- # column_type: "string",
76
- }
77
- ]
78
- end
79
- end
80
-
81
41
  factory :rename_column, class: "Hash" do
82
42
  migration_name { "Post" }
83
43
  migrations do
@@ -134,10 +94,34 @@ FactoryBot.define do
134
94
  migration_name { "Post" }
135
95
  migrations do
136
96
  [
97
+ {
98
+ action: "add_column",
99
+ table_name: "posts",
100
+ column: "content",
101
+ column_type: "text",
102
+ },
137
103
  {
138
104
  action: "add_index_to_column",
139
105
  table_name: "posts",
140
- column: "content_new",
106
+ column: "content",
107
+ },
108
+ {
109
+ action: "add_index_to_column",
110
+ table_name: "posts",
111
+ column: "content_second",
112
+ index: {
113
+ using: 'default',
114
+ unique: true,
115
+ }
116
+ },
117
+ {
118
+ action: "add_index_to_column",
119
+ table_name: "posts",
120
+ column: "content_third",
121
+ index: {
122
+ using: 'gin',
123
+ algorithm: 'concurrently',
124
+ }
141
125
  }
142
126
  ]
143
127
  end
@@ -1,40 +1,54 @@
1
1
  FactoryBot.define do
2
- factory :post_one, class: "Hash" do
3
- model_name { "Post" }
2
+ factory :post_one, class: Hash do
3
+ model_name { 'Post' }
4
4
  attributes do
5
5
  [
6
6
  {
7
- attribute_name: "title",
8
- attribute_type: "string",
9
- index: true
7
+ 'attribute_name' => 'title',
8
+ 'attribute_type' => 'string',
9
+ 'index' => {
10
+ 'using' => 'default',
11
+ 'unique' => true,
12
+ 'algorithm' => 'default',
13
+ }
10
14
  },
11
15
  {
12
- attribute_name: "content",
13
- attribute_type: "text"
16
+ 'attribute_name' => 'tags',
17
+ 'attribute_type' => 'array',
18
+ 'nullable' => false,
19
+ 'default' => '[]',
20
+ 'index' => {
21
+ 'using' => 'gin',
22
+ 'unique' => true,
23
+ 'algorithm' => 'concurrently',
24
+ }
14
25
  },
15
- ]
16
- end
17
- end
18
-
19
- factory :user_one, class: "Hash" do
20
- model_name { "User" }
21
- attributes do
22
- [
23
26
  {
24
- attribute_name: "name",
25
- attribute_type: "string",
26
- index: true,
27
+ 'attribute_name' => 'content',
28
+ 'attribute_type' => 'text',
29
+ 'nullable' => false,
30
+ 'index' => {
31
+ 'using' => 'gist',
32
+ 'algorithm' => 'default',
33
+ }
27
34
  },
28
35
  {
29
- attribute_name: "metadata",
30
- attribute_type: "jsonb"
36
+ 'attribute_name' => 'likes_count',
37
+ 'attribute_type' => 'integer',
38
+ 'nullable' => true,
39
+ 'default' => '0',
40
+ },
41
+ {
42
+ 'attribute_name' => 'score',
43
+ 'attribute_type' => 'float',
44
+ },
45
+ {
46
+ 'attribute_name' => 'metadata',
47
+ 'attribute_type' => 'jsonb',
48
+ 'nullable' => false,
49
+ 'default' => '{}',
31
50
  },
32
51
  ]
33
52
  end
34
53
  end
35
-
36
- factory :relation_one, class: "Hash" do
37
- model_one_name { "User" }
38
- model_two_name { "Post" }
39
- end
40
54
  end