ru.Bee 2.5.5 → 2.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/db/test.db +0 -0
- data/lib/rubee/cli/db.rb +6 -0
- data/lib/rubee.rb +1 -1
- data/readme.md +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b3fd10a8289d2c40aa0f9709bdf87ad2d4ff6ad8238d76f321b7e534d365d84c
|
|
4
|
+
data.tar.gz: 05c6c2f8dd162d9952204ef603d65de7f03d4be83b857440e50a5c92556caa54
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 75f0f5618b721651c6f2c3fdfe8cbd267b3b0a764b1bccbff39768b5f89903f16d8d435f5a3f4d4869635505afebf5870c2954448a780a0f3446767ffdcf2e35
|
|
7
|
+
data.tar.gz: ec7ce9f2c15cbc4eaf53118bb71f0d8a6559cbd57f82584718d9379c285eee366f33f8b66ded0363ce432f8eee55b5b15e84838bde3d65a46d5aa1b357613897
|
data/lib/db/test.db
CHANGED
|
Binary file
|
data/lib/rubee/cli/db.rb
CHANGED
|
@@ -37,6 +37,12 @@ module Rubee
|
|
|
37
37
|
generate_structure
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
+
def drop_tables(_argv)
|
|
41
|
+
out = Rubee::SequelObject::DB.tables.each { |table| Rubee::SequelObject::DB.drop_table(table, cascade: true) }
|
|
42
|
+
color_puts("These tables has been dropped for #{ENV['RACK_ENV']} env", color: :cyan)
|
|
43
|
+
color_puts(out, color: :gray)
|
|
44
|
+
end
|
|
45
|
+
|
|
40
46
|
def schema(argv)
|
|
41
47
|
target_table_hash = argv[2] ? { argv[2].to_sym => STRUCTURE[argv[2].to_sym] } : nil
|
|
42
48
|
(target_table_hash || STRUCTURE).each do |table_name, table_def|
|
data/lib/rubee.rb
CHANGED
data/readme.md
CHANGED
|
@@ -246,6 +246,20 @@ This will generate the following files
|
|
|
246
246
|
- text, type (varchar(255))
|
|
247
247
|
- user_id, type (INTEGER)
|
|
248
248
|
```
|
|
249
|
+
7. You can also rpint out the schema for the table you need
|
|
250
|
+
```bash
|
|
251
|
+
-> rubee db schema posts
|
|
252
|
+
--- posts
|
|
253
|
+
- id, (PK), type (INTEGER)
|
|
254
|
+
- user_id, type (INTEGER), nullable
|
|
255
|
+
- comment_id, type (INTEGER), nullable
|
|
256
|
+
- created, type (datetime), nullable
|
|
257
|
+
- updated, type (datetime), nullable
|
|
258
|
+
|
|
259
|
+
Foreign keys:
|
|
260
|
+
- comment_id → comments() on delete no_action on update no_action
|
|
261
|
+
- user_id → users() on delete no_action on update no_action
|
|
262
|
+
```
|
|
249
263
|
|
|
250
264
|
[Back to content](#content)
|
|
251
265
|
|