How I remove the deleted record in OAI? - oai

Please How I remove deleted records in OAI?

OJS uses “tombstones” to refer to deleted records. If you want to remove these, you can do so from the data_object_tombstones, data_object_tombstone_settings, and data_object_tombstone_oai_set_objects tables.

Related

how to delete from these jira tables

Could someone, please, tell me how to delete from the following tables:
OS_HISTORYSTEP
OS_HISTORYSTEP_PREV
OS_CURRENTSTEP
OS_CURRENTSTEP_PREV
OS_WFENTRY
I have a jiraissue's ID that I need to remove. Can I find associated records in these tables to delete as well?
Jira issue associated on JIRAISSUE.WORKFLOW_ID=OS_WFENTRY.ID
but inaccurate actions on this table easily lead you to inoperable Jira

error 3027: No mapping specified for the following EntitySet/AssociationSet - sysdiagrams(deleted the sysdiagram table by mistake)

So my problem is, I added a extra column in My one of the table in database in SQL and i wanted to reflec that change in my MVC project. So what i usually do is update the model from the database and it works all the time.But this time it didnt worked so i thought let me delete the table from Project1Model.Store>Tables/Views from the EDMX Model Browser and then update the model from Database(which worked in past for me). But by mistake deleting the SessionDetail table i deleted the sysdiagram table from tables/Views.
Now i dont have sysdiagram table in my Tables/Views section but i can see that table in diagram and in EntityTypes. I tried generating model from databse but didnt worked. I dont want to create Database from Model because i know i deleted something from my model and dont want to effect my database which is fine(let me know if i am wrong this the right way).
I still get this error after built the solutions. Let me know how i can recreate the sysdiagram table in my Table/Views section.
Thanks in Advance.
-Arpan
I had the same error and went to the .edmx and deleted the sysdiagram table and everything worked well.
I initially had been connected to a database that had a database diagram but later I connected to a copy of that database but without a diagram which I guess was the source of the problems.
So to conclude first check if you have a diagram in the db, if not either recreate it and update your model from db, alternatively completely delete sysdiagrm table from your model.

How to delete all posts from my PostgreSQL table?

I'm building a Rails app in which one of the functions is that the user can write journal entries and save them. I'd like to remove every journal entry from the respective PostgreSQL table they're in. How do I do this?
# assuming your journal entries are a model named Entry
Entry.find(:all).each { |e| e.destroy! }
Probably not the most efficient way, but it will do what you ask.
If you don't care about callbacks and just want to delete everything in the table, you can use delete_all:
JournalEntry.delete_all
If you do want callbacks executed, you can use destroy_all:
JournalEntry.destroy_all

seed-fu data removing

I try to change data loaded by seed-fu in rails project database.
And cant find any standard way to delete rows
Seed-fu can:
1. create new record.
2. update existing.
Is it possible to delete some records.
Database already in production use and we cant simply recreate all data from scratch.
Any suggestions ?
You can't update or delete with it. Use ActiveRecord to do that.
User.find().destroy
as the other user you could use normal destroy:
User.destroy(id)

Empty database in rails

What is the best way to test for an empty database in rails? I generated a model chardata and the controller, Chardatum. I want to loop through the database and extract a certain column, but I need a way to test if the database is empty first.
If you are fetching some Chardata allready you could do:
#chardata.any?
It depends on two things.
What kind of database are you using?
And by empty, do you mean the tables have not been created yet? or just that data has not been inserted yet in to the tables?
To see if the chardatas table has no rows before proceeding:
Chardata.count.zero?
Assuming you're using MySQL, you can use the following command to see if tables have been created already in your database
Chardata.count_by_sql "SELECT COUNT(DISTINCT 'table_name') FROM 'information_schema'.'columns' WHERE 'table_schema' = 'your_db_name'".zero?
You can also check if the table has been created with CharDatum.table_exists?.

Resources