Forum

Please or Register to create posts and topics.

Group Table with null GroupID values

in my Group Table I noticed I have null values in  GroupID col,

I would have thought database tools would have cleaned up "orphans", however that does not seem to have happened. I can clean them up manually but what wondered if I was missing anything.

Select count(rowid)
FROM GroupTable
Where GroupID is null

resulted in 1406 rows

(see screenshot)

Can I just Delete all rows Where GroupID is null?

 

 

 

 

 

Uploaded files:
  • Screenshot-2024-07-23-193216.jpg

I have never seen that. I wonder if it's a bug in RM, or if it's the result of a deliberate but quick and dirty way to delete somebody from the GroupTable on the theory that a more compressive cleanup will take place later.

I notice that every row in your screen shot is for a single person, whereas a single row in the GroupTable often is for a range that is multiple people. I wonder if the fact that all the rows are for a single person might be a clue as to what's going on.

I further wonder if these people might have been added and then deleted from the Group table by unchecking them from the Groups line in the Edit Person screen. I have never done it that way and I always use a criterion for a group (and now in RM 10.0.1, I always use a set of rules).

I can't think of any earthly reason not to delete those rows.

Well its possible I used SQL to create a group, however RM would be aware of that group after I created  (that would explain start/end being  a range of "one" id.

(example missing Media) which can not be done yet in RM.  I would only delete groups from with RM -- I am guessing some thing during RM9. I can not blame RM but I can not rule out  possible bug.  Most likely a user error or maybe script did not fully complete.  I suppose its possible it was something converting from RM9 to RM10 -- but that seem quite unlikley.

 

example of one of my missing media scripts below.

Thank I will delete them as worse case I can re-create group.

-- Create Named Group if it does not exist 'SQL: Media Missing FaG'

INSERT OR IGNORE INTO TagTable
VALUES
(
(SELECT TagID FROM TagTable WHERE TagName LIKE 'SQL: Media Missing FaG')
,0
,(SELECT IFNULL(MAX(TagValue),0)+1 FROM TagTable)
,'SQL: Media Missing FaG'
,'SQLite query'
,julianday('now') - 2415018.5
)
;

-- Delete all members of the named group
DELETE FROM GroupTable
WHERE GroupID =
(SELECT TagValue
FROM TagTable a
WHERE TagName
LIKE 'SQL: Media Missing FaG'
)
;
-- Add members to the named group
INSERT INTO GroupTable
SELECT
null
,(SELECT TagValue
FROM TagTable
WHERE TagName
LIKE 'SQL: Media Missing FaG'
)
,PersonID AS StartID
,PersonID AS EndID
,(julianday('now') - 2415018.5) AS UTCModDate

FROM
(
SELECT
E.OwnerID AS PersonID
FROM
FactTypeTable AS FT
LEFT JOIN
EventTable AS E
ON FT.FactTypeID=1 AND E.OwnerTYPE = 0 AND E.EventType = 1002 -- SQL: Media Missing FaG
LEFT JOIN
MediaLinkTable AS ML ON ML.OwnerType = 2 AND ML.OwnerID = E.EventID
WHERE
ML.LinkID IS NULL and E.OwnerID is NOT NULL
)