Forum OpenACS Q&A: Re: myfirstpackage: ERROR: duplicate key violates unique constraint

It looks like perhaps you used a different name when creating the type than when deleting it?

"drop view mfp_notesi" indicates this view is built for the type "mfp_notes". You're sure there's not a typo in the type name in the create call?

Thanks for yor reply.

Unfortunately, after double checking the create call file, I pasted over it to try again, so I can't be absolutely sure at this point.

If I assume that I did make a type in the type name, is there anyway to undo the mess?

Rick

I think it might be a problem with the documentation (content_type__drop_type). Someone here at work that is doing some self directed training ran into the same problem. Must be this page: https://openacs.org/doc/current/tutorial-database.html

I chatted with Dave briefly about it. He mentioned it could have something to do with a change in the way views work so that they are not getting dropped?

Hi. There is another error someone may run into later on while following the myfirstpackage tutorial. It took me a while to understand what was wrong with it:
Further down at the admin pages section(Advanced topics), you are supposed to add an admin section to the myfirstpackage:

look into the file: index.tcl (admin folder)

ad_page_contract {} {
} -properties {
context_bar
}

set package_id [ad_conn package_id]

permission::require_permission \
-object_id $package_id \
-privilege admin]

set context [list]

set title "Administration"

set parameters_url [export_vars -base "/shared/parameters" {
package_id { return_url [ad_return_url] }
}]

Please look at the permission section. The bracket after
admin should go. This creates problems 'cause the -privilege is not "admin" but "admin]". Most likely the bracket was left there by mistake.

Hope this helps too.

I am sorry, I have to correct myself too:
The privilege should be "admin" and not "admin]"

code should be:
permission::require_permission \
-object_id $package_id \
-privilege admin