Add a fqn field to blogs and users #457

Merged
elegaanz merged 6 commits from fqn into master 2019-03-06 17:28:10 +00:00
elegaanz commented 2019-03-05 10:16:55 +00:00 (Migrated from github.com)

Fixes #319

Fixes #319
codecov[bot] commented 2019-03-05 12:29:19 +00:00 (Migrated from github.com)

Codecov Report

Merging #457 into master will increase coverage by 0.75%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master     #457      +/-   ##
==========================================
+ Coverage   26.49%   27.25%   +0.75%     
==========================================
  Files          64       64              
  Lines        7111     7310     +199     
==========================================
+ Hits         1884     1992     +108     
- Misses       5227     5318      +91
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/457?src=pr&el=h1) Report > Merging [#457](https://codecov.io/gh/Plume-org/Plume/pull/457?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/2a188abfa152efe7a2794174279e3b9da4a809d1?src=pr&el=desc) will **increase** coverage by `0.75%`. > The diff coverage is `50%`. ```diff @@ Coverage Diff @@ ## master #457 +/- ## ========================================== + Coverage 26.49% 27.25% +0.75% ========================================== Files 64 64 Lines 7111 7310 +199 ========================================== + Hits 1884 1992 +108 - Misses 5227 5318 +91 ```
igalic (Migrated from github.com) reviewed 2019-03-05 17:03:15 +00:00
igalic (Migrated from github.com) left a comment

igalic (Migrated from github.com) commented 2019-03-05 16:48:28 +00:00

what makes you think i managed to correctly create my instance in go?

what makes you think i managed to correctly create my instance in go?

I'm wondering. On a brand new, uninitialized instance, does it works? The select would return 0 rows, so does the CASE never match, or does it fail?

I'm wondering. On a brand new, uninitialized instance, does it works? The select would return 0 rows, so does the CASE never match, or does it fail?
elegaanz commented 2019-03-05 19:07:57 +00:00 (Migrated from github.com)

I think it will never run, since there are no blogs or users, so no problem.

I think it will never run, since there are no blogs or users, so no problem.
trinity-1686a reviewed 2019-03-05 19:09:47 +00:00
@ -0,0 +4,4 @@
(CASE WHEN (SELECT local FROM instances WHERE id = instance_id) THEN
actor_id
ELSE
(actor_id || '@' || (SELECT public_domain FROM instances WHERE id = instance_id LIMIT 1))

why LIMIT 1? Isn't id unique?

why LIMIT 1? Isn't id unique?
elegaanz (Migrated from github.com) reviewed 2019-03-05 19:47:35 +00:00
@ -0,0 +4,4 @@
(CASE WHEN (SELECT local FROM instances WHERE id = instance_id) THEN
actor_id
ELSE
(actor_id || '@' || (SELECT public_domain FROM instances WHERE id = instance_id LIMIT 1))
elegaanz (Migrated from github.com) commented 2019-03-05 19:47:35 +00:00

Just to be sure. 😛

Just to be sure. :stuck_out_tongue:
trinity-1686a reviewed 2019-03-06 09:59:16 +00:00

sqlite doesn't allow to drop column, you have to do the annoying copy thing

sqlite doesn't allow to drop column, you have to do the annoying copy thing
elegaanz (Migrated from github.com) reviewed 2019-03-06 10:04:04 +00:00
elegaanz (Migrated from github.com) commented 2019-03-06 10:04:04 +00:00

Ah, yes, forgot about that… 😑

Ah, yes, forgot about that… :expressionless:
trinity-1686a reviewed 2019-03-06 10:54:07 +00:00
trinity-1686a left a comment
Owner

the no_fqn tables are maybe to close of their "with fqn" counterpart?

the no_fqn tables are maybe to close of their "with fqn" counterpart?

blogs_no_fqn, fqn TEXT NOT NULL...

`blogs_no_fqn`, `fqn TEXT NOT NULL`...

users_no_fqn, fqn TEXT NOT NULL...

`users_no_fqn`, `fqn TEXT NOT NULL`...
elegaanz (Migrated from github.com) reviewed 2019-03-06 10:56:36 +00:00
elegaanz (Migrated from github.com) commented 2019-03-06 10:56:36 +00:00

Ah, that's why it was telling me I was not supplying enough values when doing INSERT INTO blogs_no_fqn SELECT all, the, columns, but, not, fqn FROM blogs;. 😬

Ah, that's why it was telling me I was not supplying enough values when doing `INSERT INTO blogs_no_fqn SELECT all, the, columns, but, not, fqn FROM blogs;`. :grimacing:
trinity-1686a reviewed 2019-03-06 13:14:19 +00:00
@ -43,6 +43,7 @@ table! {
ap_url -> Text,
private_key -> Nullable<Text>,
public_key -> Text,
fqn -> Text,

this is not supposed to be Nullable, but I don't get where it come from, your migrations aren't touching this table

this is not supposed to be Nullable, but I don't get where it come from, your migrations aren't touching this table
elegaanz (Migrated from github.com) reviewed 2019-03-06 13:24:57 +00:00
@ -43,6 +43,7 @@ table! {
ap_url -> Text,
private_key -> Nullable<Text>,
public_key -> Text,
fqn -> Text,
elegaanz (Migrated from github.com) commented 2019-03-06 13:24:57 +00:00

Diesel is regenerating the schema when running migrations, so it changed when I tested with SQlite.

Diesel is regenerating the schema when running migrations, so it changed when I tested with SQlite.
trinity-1686a reviewed 2019-03-06 13:42:30 +00:00
@ -43,6 +43,7 @@ table! {
ap_url -> Text,
private_key -> Nullable<Text>,
public_key -> Text,
fqn -> Text,

For some reason, comment_seers's id is an INTEGER PRIMARY KEY AUTOINCREMENT, not an INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT on sqlite (but fine on pg I assume), that's why the scheme was invalid
Edit : I know why, this was introduced in this commit : fdfeeed6d9 , my bad

For some reason, comment_seers's id is an `INTEGER PRIMARY KEY AUTOINCREMENT`, not an `INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT` on sqlite (but fine on pg I assume), that's why the scheme was invalid Edit : I know why, this was introduced in this commit : fdfeeed6d9fa9dec92862366a8b646eb27d17422 , my bad
trinity-1686a approved these changes 2019-03-06 16:51:52 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Plume/Plume#457
No description provided.