[REQ] Where is the full content of oc_calendarobjects_props/value stored

I add a note to an calendar entry e.g. in iCal which has a length of e.g. 800 chars. When I look into the database in oc_calendarobjects_props the field “value” is varchar(255) and just displays the 254 chars.
QUESTION:
• Where is the full text stored?
• Can I just change the field to e.g. “Longtext”?
• Is it possible to “create” a new calendar entry via creating all required records in the database? (I want to “inject” calendar entries from a tool which just has access to the database).

Thanks in advance

In the column calendardata of the database table oc_calendarobjects (your table prefix might be different from oc_).

I would not recommend to change the layout of the database.

I would also not recommend to writing calendar items directly into the database. Clients will become out of sync and also other tables related to the calendar functionality might get out of sync with oc_calendarobjects.

Can‘t you get the data from your tool and write it to the database with a caldav request? That would be a much better approach.

1 Like

In the column calendardata of the database table oc_calendarobjects (your table prefix might be different from oc_ ).

Great I found it! Now I understand why you don’t recommend to writing directly.

I think I can perform a CURL with the app. But since I’m a complete newbie on that would it be too much asked to give me an example of a full CURL-request, e.g. to insert a new calendar entry? That would be very much appreciated!

Create a file event.ics with the desired event data (the uid must be unique):

Summary
BEGIN:VCALENDAR
PRODID:-//IDN nextcloud.com//Calendar app 2.1.3//EN
CALSCALE:GREGORIAN
VERSION:2.0
BEGIN:VEVENT
CREATED:20210222T055359Z
DTSTAMP:20210222T055424Z
LAST-MODIFIED:20210222T055424Z
SEQUENCE:2
UID:12345678-1234-1234-1234-123456789abc
DTSTART;TZID=Europe/Berlin:20210222T140000
DTEND;TZID=Europe/Berlin:20210222T160000
SUMMARY:dummy
END:VEVENT
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
END:VCALENDAR

and upload it to the desired calendar with a PUT request:

curl -X PUT --data-binary @"event.ics" -u [USERNAME]:[PASSWORD] https://[NEXTCLOUD.EXAMPLE.COM]/remote.php/dav/calendars/[USERNAME]/[CALENDARNAME]/12345678-1234-1234-1234-123456789abc.ics
1 Like

Great! Thank you!
That pointed me in the right direction and I was able to upload the file. Now I have to figure out how to just upload the text w/o exporting and creating an .ics first.

1 Like