Gov. Nikki Haley signed the bill today that would make it harder for mentally ill people to get their hands on guns. The bill had passed the Legislature on Thursday.

The so-called “Ashley Hall Bill” was drafted after a Beaufort woman allegedly attempted to shoot an official outside a private school in Charleston.

The legislation, filed as H3560, would create a database of people judged to be mentally defective, such as those deemed by the courts to be incompetent, or people involuntarily sent to a mental institution.

Alice Boland, 28, tried to fire a handgun at officials at Ashley Hall school in downtown Charleston Feb. 4, according to police. She pulled the trigger, but the gun didn’t go off because no round was in the chamber, according to investigators.

Boland had previously pleaded not guilty by reason of mental incompetence to threatening to kill President George W. Bush in 2005. But that plea didn’t appear in a federal background check when Boland went to buy the gun she took to Ashley Hall because South Carolina doesn’t share that information.

S.C. Attorney General Alan Wilson called the bill “one of the year’s most important pieces of legislation.” He said the legislation in no way infringes on the rights of “law-abiding South Carolinians” but “simply ensures that people who are not lawfully allowed to carry a gun cannot get one.”

Rep. Leon Stavrinakis, D-Charleston, one of the sponsors, said, “With the passage of this bill, no one with a criminal history of mental illness will be able to legally purchase a firearm in South Carolina.”