There will now be severe consequences for teachers involved in inappropriate relationships with students in their classrooms.

Thursday, Governor Greg Abbott signed Senate Bill 7, also known as the "pass the trash" bill into law.

"Pass the Trash" refers to instances when an educator is accused of having an improper relationship with a student but isn't turned in to police because they resign once administrators find out. In many cases, those educators then start working at another school, where they do the same thing. So those districts are said to have "passed the trash" from one school to another.

Read More: FED UP: Leaders battling ‘alarming rate' of inappropriate teacher-student relationships

Senator Paul Bettencourt (R-Houston) wrote SB 7 to stop the practice. His bill creates a statewide database to track the offenders, has harsher consequences and punishes administrators who don't report the bad apples.

"There's also, in part, the fault of reprehensible principals and superintendents who sometimes try to sweep this whole problem under the rug," Abbott said.

"Those principals and those superintendents also are going to face stiff consequences because of this law. So I am proud to sign SB 7 to restore the trust that should exist between teachers and students and also between parents and teachers," he added.

Under SB7, teachers guilty of improper relationships will automatically be fired, lose their teaching certificates and their pensions. Administrators who don't report the teacher within seven business days can be fined up to $10,000. And if they try to cover it up, they can go to jail.

School districts are also required to adopt a written policy to prevent inappropriate electronic communication between teachers and students.

The law takes effect Sept. 1.