A migraine is a specific type of headache that can't be prevented by taking a few painkillers. Trust me I get them. All migraines have a trigger. A true migraine is a 3 day event unless I take the medication at the onset. The med is no picnic either; it makes me extremely nauseous for about 24 hours, but it does stop the migraine.
That being said, it is likely something at the school that is bothering you. That is hard to pinpoint; could be the lighting, the air, someone's perfume or cologne, the chemicals they use to clean with. It could also be anxiety or stress, or it very well could be your eyes. Have your eyes checked. It could also be something you are eating. For example artificial sweeteners are known to cause headaches in some people.
Migraine or not, I hope you figure this out. Having a constant headache makes it hard to function and taking that many painkillers is not healthy for your body over time, could cause kidney damage or other issues. Best of luck